为什么curl无法建立连接但openssl成功

时间:2015-07-30 06:46:08

标签: curl openssl ssl-certificate

当我从我的框中运行以下命令时 -

$ openssl s_client -connect **xx.xx.xx.xx:xxxxx** -tls1

Please note that when I use the command like below :

$ openssl s_client -connect **https://xx.xx.xx.xx:xxxxx** -tls1 

I get below error:

getservbyname failure for //xx.xx.xx.xx:xxxxx
usage: s_client args

我连接到xx.xx.xx.xx:xxxxx,下面是输出[提取]:

CONNECTED(00000003)
No client certificate CA names sent
---
SSL handshake has read 3445 bytes and written 423 bytes
...........

但是当我通过curl尝试相同的操作时,它失败并出现以下错误:

$curl -v -1 https://xx.xx.xx.xx:xxxxx

* SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
* Closing connection #0
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

如何在没有任何问题的情况下连接到同一个盒子端口?

1 个答案:

答案 0 :(得分:0)

Skip the certificate检查CURL

$curl -v -k -1 https://xx.xx.xx.xx:xxxxx

或获取相应的证书和add it to curl