我正在尝试使用cUrl连接到第三方服务器。他们提供了一个p12文件,我已经在浏览器中安装了它。在使用浏览器时,我能从服务器获得响应。但是,在Linux终端执行cUrl命令时,我遇到了握手错误。
我将.p12文件提取为密钥和证书,然后运行以下命令:
我将.p12文件提取为密钥和证书,然后运行以下命令:
curl --key client.key --cert client.crt -X GET -v https://x.x.x.x:xxxx/folder/endpoint
然后收到以下回复:Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying x.x.x.x...
* TCP_NODELAY set
* Connected to x.x.x.x (x.x.x.x) port xxxx (#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 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* stopped the pause stream!
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
我需要在哪里添加自签名证书?感觉我漏掉了什么。如前所述,当我从已导入证书的浏览器中访问时,它可以工作,所以我确定他们的证书没有问题。但我知道我漏掉了什么。
谢谢,