为什么尝试使用 cURL API 时出现此错误?OpenSSL SSL_connect:连接被对等方重置,以连接到

为什么尝试使用 cURL API 时出现此错误?OpenSSL SSL_connect:连接被对等方重置,以连接到

以下问题让我抓狂。前段时间,我能够使用以下涉及使用 SSL 证书的 cURL 命令从某些 API 检索数据,但现在我收到以下错误消息:

andrea@ubuntu:~/Desktop/certificati/abc/abc$ sudo curl --location --cert client2.cer --key client2.key --pass "password"  --request  GET "https://myserver.myorganization.it/ws-application/service/distretti/_/_/_"  -v
[sudo] password for andrea: 
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying SERVER IP ADDRESS:443...
* TCP_NODELAY set
* Connected to myserver.myorganization.it (SERVER IP ADDRESS) 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.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: Connection reset by peer in connection to myserver.myorganization.it:443 
* Closing connection 0
curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to myserver.myorganization.it:443 

此错误的原因可能是什么?我该如何调试它?

我也有 CA 证书文件,我可以尝试用我的客户端证书\密钥文件来验证它吗?

相关内容