ubuntu 18.04 无法连接某些 HTTPS 站点

ubuntu 18.04 无法连接某些 HTTPS 站点

我刚刚格式化了我的笔记本电脑并全新安装了 Ubuntu 18.04。在安装一些开发包时,我发现使用 ruby​​gems 和 python pip 都存在问题。它给出了与 SSL 相关的错误。我也无法访问他们的网站。(连接重置错误消息)

安装最新版本的 PIP 时出错

Connected to bootstrap.pypa.io (2a04:4e42::175) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [215 bytes data]
* TLSv1.2 (IN), TLS handshake, Server hello (2):
{ [112 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [3805 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [300 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [37 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to bootstrap.pypa.io:443 
* stopped the pause stream!
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to bootstrap.pypa.io:443 

还有 ruby​​gems:

gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/specs.4.8.gz)

编辑:

我甚至无法使用 curl 连接到 curl 网站:

➜ curl -v https://curl.haxx.se/mail/archive-2015-08/0015.html
*   Trying 2a04:4e42::561...
* TCP_NODELAY set
* Connected to curl.haxx.se (2a04:4e42::561) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to curl.haxx.se:443 
* stopped the pause stream!
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to curl.haxx.se:443 

我尝试更新 openssl 和 ca-certificates 包,但问题依旧。 Openssl 版本:OpenSSL 1.1.0g 2017 年 11 月 2 日

有人知道发生了什么吗?几天前在虚拟机中没有发生这种情况。

编辑在连接到同一网络并以相同方式配置的虚拟机中再次测试,发现一切正常!!真的很奇怪。

谢谢。

答案1

我通过禁用机器上的 ipv6 解决了这个问题。不知道为什么,但确实有效。

要在 Ubuntu 或 Linux Mint 上禁用 ipV6,请按照本教程操作:https://support.purevpn.com/how-to-disable-ipv6-linuxubuntu

在网络管理器中禁用是不够的。

相关内容