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.

  • Tool to automate Docker Swarm
  • How can I setup a instance EC2 with docker and access it with the IP?
  • Should I containerize a standalone command-line or terminal application which requires 16 vCPU?
  • Tomcat deployment using Docker and Kubernetes
  • How to generate a certificate for AWS EC2 instance part of AWS ECS ( Docker)
  • docker build taking too much time in aws ecs
  • 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

  • How to share java-packages between docker-container via link?
  • Why does different container of same elasticsearch image on docker exits out?
  • Docker mount directory access rights
  • How to log PHP errors in an AWS Elastic Beanstalk Docker container
  • Maintaining and supporting container base images
  • What is the difference between exposing docker port and creating bridge(or overlay)?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.