2012-11-14 193 views
3

我已經從here下載了cURL for Windows。我選擇了Win64 - Generic版本,但沒有SSL。我嘗試從命令行運行curl https://www.google.com,出現以下錯誤:curl: (1) Protocol https not supported or disabled in libcurl如何從Windows命令行獲取cURL?

好吧!接下來,我決定下載SSL的版本並安裝它。我嘗試運行與上面相同的命令,並且出現以下錯誤:

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 

curl performs SSL certificate verification by default, using a "bundle" of Certificate 
Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you 
can specify an alternate file using the --cacert option. 
If this HTTPS server uses a certificate signed by a CA represented in 
the bundle, the certificate verification probably failed due to a 
problem with the certificate (it might be expired, or the name might 
not match the domain name in the URL). 
If you'd like to turn off curl's verification of the certificate, use 
the -k (or --insecure) option. 

接下來應該做什麼?

+0

如果您想在Windows命令提示符下使用curl,請按照[教程](http://a2znotes.blogspot.in/2015/02/install-and-configure-curl-on-windows.html)中的說明操作。它提供了有關安裝的有用信息。 –

回答

3

以下是我所做的解決問題的方法。

我得到了Mozilla從here使用的CA根證書的捆綁包。我複製了頁面中的數據並將其保存在curl.exe文件所在的文件夾中的一個名爲curl-ca-bundle.crt的新文件中。這解決了問題。

當然,這些指令也捲曲documentation page for SSL certificates發現,恰恰說明4和5

希望有所幫助。

+0

另一個來源和下載鏈接:http://curl.haxx.se/docs/caextract.html – CSchulz