什么是 NSS 错误 -5961 (PR_CONNECT_RESET_ERROR)

mic*_*rip 23 ssl openssl

有人可以启发我“NSS错误-5961(PR_CONNECT_RESET_ERROR)”的含义吗?

我正在尝试使用“https”协议连接到 bitbucket.org,但被服务器拒绝。然后,我尝试在命令行上使用 curl 并查看此输出。

# curl -v https://bitbucket.org
* About to connect() to bitbucket.org port 443 (#0)
*   Trying 131.103.20.168...
* Connected to bitbucket.org (131.103.20.168) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -5961 (PR_CONNECT_RESET_ERROR)
* TCP connection reset by peer
* Closing connection 0
curl: (35) TCP connection reset by peer
Run Code Online (Sandbox Code Playgroud)

使用 openssl,我得到了这个输出。

# openssl s_client -connect bitbucket.org:443 -msg
CONNECTED(00000003)
>>> TLS 1.2 Handshake [length 00f4], ClientHello
    01 00 00 f0 03 03 55 59 80 fa 72 25 f4 a5 84 49
... <I suspended this Hex value>
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 249 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
Run Code Online (Sandbox Code Playgroud)

Ste*_*ich 26

对等方重置 TCP 连接

这个来自 NSS 的错误与你使用 openssl 得到的错误相同(errno=104: ECONNRESET)。这只是意味着,对等方或中间的某个中间件(防火墙)正在终止连接。

由于从我的位置可以访问该站点,因此我建议您的站点上有防火墙阻止连接。这种行为对于 DPI 防火墙来说是相当典型的,因为允许初始 TCP 连接,但是一旦您发送第一个数据(来自 TLS 握手的 ClientHello),它将确定您的访问是否被策略允许,并通过注入 TCP 让它通过或拒绝它回复