Cannot connect to HTTPS (443) from a docker container but http request are connecting

cannot connect to https from a wordpress container. but http request are connecting from it
please help us to resole this issue.

traces:
inside the container:-

root@7402e953b725:/var/www/html# curl -i “http//www.google.com”
curl: (7) Failed to connect to www.google.com port 443: Connection refused
root@7402e953b725:/var/www/html#

but its connecting from the host machine

iptable rules:-

[root@tnmmsdpmportal03p ~]# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DOCKER all – anywhere anywhere ADDRTYPE match dst-type LOCAL
DNAT tcp – anywhere anywhere tcp dpt:https to:172.17.0.2:443

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER all – anywhere !loopback/8 ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all – 172.17.0.0/16 anywhere
MASQUERADE tcp – 172.17.0.2 172.17.0.2 tcp dpt:http

Chain DOCKER (2 references)
target prot opt source destination
RETURN all – anywhere anywhere
DNAT tcp – anywhere anywhere tcp dpt:http to:172.17.0.2:80
You have mail in /var/spool/mail/root

1 Like