cURL到https URL是否需要在服务器上安装SSL证书?

时间:2016-02-12 18:46:24

标签: ssl curl https

我正在尝试从我的服务器测试cURL命令。该命令正在从JSON的URL请求https响应。

cURL似乎陷入困境,没有任何反应,也没有超时。

但是,我已经在本地计算机上测试了它,cURL命令工作正常。

我是否需要在服务器上安装SSL证书才能将cURL命令发送到https网址?

1 个答案:

答案 0 :(得分:0)

No you don't need an SSL cert to send a command like curl via https (unless your server uses two way ssl).

You DO need one at the other end for the https server that receives the command from curl.

However if it's a self signed cert then it may not be recognised by curl and you may get an error instead of a successful connection.

The fact the process is hanging suggests a network/connectivity issue rather than an SSL issue. Can you telnet to the machine using port 443 or does that hang too?

telnet www.example.com 443

Should respond.