首页 > 解决方案 > 无法从 RHEL 连接到远程服务器上的 SSL。OpenSSL 写入:errno=110

问题描述

好的,所以在过去的几天里,这一直让我发疯。

我的 RHEL 服务器位于公司防火墙后面。我已请求在端口 443 和端口 80(传入和传出)上打开规则,以访问为我正在查询的 URL api.mgmt.cloud.vmware.com 提供的三个 ip。据我所知,这已经完成,我在连接方面取得了一些有限的成功。

根据我所看到的,我认为这不是连接问题,而是与证书有关。例如,我可以在 443 端口上成功 telnet 到这个 url。

的输出openssl s_client -connect api.mgmt.cloud.vmware.com:443 -servername api.mgmt.cloud.vmware.com -showcerts

我编辑,可能没有必要,因为这将是公开的,但以防万一......

CONNECTED(00000003)
depth=4 C = US, O = "Starfield Technologies, Inc.", OU = Starfield Class 2 Certification Authority
verify return:1
depth=3 C = US, ST = Arizona, L = Scottsdale, O = "Starfield Technologies, Inc.", CN = Starfield Services Root Certificate Authority - G2
verify return:1
depth=2 C = US, O = Amazon, CN = Amazon Root CA 1
verify return:1
depth=1 C = US, O = Amazon, OU = Server CA 1B, CN = Amazon
verify return:1
depth=0 CN = api.mgmt.cloud.vmware.com
verify return:1
write:errno=110
---
Certificate chain
*REDACTED*
---
Server certificate
subject=/CN=api.mgmt.cloud.vmware.com
issuer=/C=US/O=Amazon/OU=Server CA 1B/CN=Amazon
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 5319 bytes and written 126 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 6D9A431FAFA4C4B41F16F9B676208CBAC94C669E0361EF1A7A4D1D65C33E4A6C
    Session-ID-ctx:
    Master-Key: *REDACTED*
    Key-Arg   : None
    Krb5 Principal: None
    PSK identity: None
    PSK identity hint: None
    Start Time: 1629846227
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)
---

证书被返回,但经过很长时间的延迟,可能是超时。

特别是,我找不到任何关于什么的信息write:errno=110,即输出挂起 15 分钟左右的地方,是什么意思。

最终,我有需要查询此 URL 的 python 脚本,但它们在 SSL 握手时失败。我做了很多谷歌搜索并尝试了以下方法。

卷曲的输出:

curl -v https://api.mgmt.cloud.vmware.com
* About to connect() to api.mgmt.cloud.vmware.com port 443 (#0)
*   Trying 52.33.236.153...
* Connected to api.mgmt.cloud.vmware.com (52.33.236.153) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /path/to/tls/certs/ca-bundle.crt
  CApath: none
* Operation timed out after 300160 milliseconds with 0 out of 0 bytes received
* Closing connection 0

本地机器的连接很好,openssl s_client -connect api.mgmt.cloud.vmware.com:443 -servername api.mgmt.cloud.vmware.com -showcerts除了该行之外,输出完全相同write:errno=110,并且在几秒钟内完成

感谢任何有助于解决此问题的指针。

谢谢。

标签: networkingssl-certificaterhel8

解决方案


推荐阅读