AWS: docker container cannot connect to external website on SSL

On my ec2 instance, there is a container hosting a website (e.g. WordPress).
This containers binds container ports 80 and 443 to ports 8080 ad 8081 of the host (both are enabled for inbound traffic in the security group).

The problem is that the website inside the container needs to connect to external websites on SSL, but it fails in doing so.

  • Cannot authenticate to Docker in Elastic Beanstalk through S3
  • Kubernetes: how to set VolumeMount user group and file permissions
  • Use --build-arg value in Dockerfile FROM parameter
  • docker website opens after a while - ec2/virtualbox
  • AWS ECS running a task that requires many cores
  • Error “python: not found” in Dockerized PHP application hosted on Elastic Beanstalk
  • It looks like a problem of the security group/firewall…but I coudn’t detect the specific cause yet, as the security group is now it should work.

    If I enter the container, ping of the external website (e.g. wordpress.org) works.

    I don’t know if it is related, but recently the EC2 instance had problem validating ssl certificates, even the python pip tool wasn’t able to validate SSL certificate inside the container.

    Any help?
    Does wordpress use another port – no 443 port – to connect to wordpress.org?

    EDIT1:

    • the specific error message is the following:

    SSL certificate problem: unable to get local issuer certificate

    • one the website is WordPress, and it logs the following message:

    Warning: An unexpected error occurred. Something may be wrong with
    WordPress.org or this server’s configuration. If you continue to have
    problems, please try the support forums. (WordPress could not
    establish a secure connection to WordPress.org. Please contact your
    server administrator.) in /var/www/html/wp-includes/update.php on line
    457

    • the website is not configured to serve https
    • inside both the container and the host the packet ca-certificates is installed

  • Docker - Not able to telnet Linked Container
  • Using pm2 Inside of an Auto-Scaling Environment
  • Docker Exec Cronjobs Filling Ec2 instance disk space, why?
  • Can I populate the content of the Volume I created in Bluemix Containers?
  • fedora 24 run docker 32-bit image
  • elastic-beanstalk docker app not updating upon deploy
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.