gpt4 book ai didi

docker - 无法从 Docker 镜像连接到 HTTPS (443)

转载 作者:行者123 更新时间:2023-12-05 00:14:51 24 4
gpt4 key购买 nike

我在新的专用服务器上安装了 docker(在通用的 ubuntu 14.0 - linux 内核 3.13.0-71 上)。
我安装了一个ubuntu docker镜像来测试环境。 ( docker run -it ubuntu bash )并且我安装了带有 openssl 支持的 curl。

当我尝试获取 HTTP 页面的内容时,我没有问题。当我尝试加载 HTTPS 页面时,我的连接被拒绝:

root@835f01fef568:/# curl https://www.google.com
curl: (7) Failed to connect to www.google.com port 443: Connection refused

在详细模式下,我有:
root@835f01fef568:/# curl -V https://www.google.com
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP

如果我尝试在文件中记录跟踪,我有:
== Info: Rebuilt URL to: https://www.google.com/
== Info: Hostname was NOT found in DNS cache
== Info: Trying 173.194.123.81...
== Info: connect to 173.194.123.81 port 443 failed: Connection refused
== Info: Trying 173.194.123.84...
== Info: connect to 173.194.123.84 port 443 failed: Connection refused
== Info: Trying 173.194.123.80...
== Info: connect to 173.194.123.80 port 443 failed: Connection refused
== Info: Trying 173.194.123.82...
== Info: connect to 173.194.123.82 port 443 failed: Connection refused
== Info: Trying 173.194.123.83...
== Info: connect to 173.194.123.83 port 443 failed: Connection refused
== Info: Trying 2607:f8b0:4006:80c::1013...
== Info: Immediate connect fail for 2607:f8b0:4006:80c::1013: Network is unreachable
== Info: Failed to connect to www.google.com port 443: Connection refused
== Info: Closing connection 0

我对我能做的事情有点迷茫:(
这不是 DNS 问题,因为我可以在端口 80 上 ping 服务器或 CURL http 内容。它仅与 SSL 连接有关。
这里有人对这个问题有任何想法吗?

谢谢

最佳答案

我找到了问题的根源。这里与主主机的一个iptables问题有关

使用命令 iptables -L -t nat我发现所有重定向到端口 9092 的 https 流量都激活了预路由,供其他服务使用。

关于docker - 无法从 Docker 镜像连接到 HTTPS (443),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34319369/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com