2012-08-01 59 views
2

我最近升級到OS X Mountain Lion,當我運行curl-config --ca時,我得到一個空行。有關詳細捲曲:Mountain Lion升級後捲曲的SSL證書消失

curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5 
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp  smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz 

的問題是,我不能運行brew update,除非我更新證書,因爲我得到以下錯誤:

Initialized empty Git repository in /usr/local/.git/ 
error: SSL certificate problem, verify that the CA cert is OK. Details: 
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/mxcl/homebrew.git/info/refs 
fatal: HTTP request failed 
Error: Failure while executing: git fetch origin 

家釀幫助論壇說,我需要更新證書。但是,除非我能找到curl存儲證書的位置,否則我無法更新它。

編輯:由下面HeatfanJohn提出的解決方案:

I just noticed that there is a Macport for curl-ca-bundle. Sorry for the possibly simple question, but did you install curl or did it come preinstalled? You might want to consider installing MacPorts and then installing curl-ca-bundle using MacPorts, although looking quickly at the Portfile this MacPort appears to just put the bundle into /usr/share which you can also do manually.

的命令從MacPorts的安裝是port install curl。從MacPorts安裝可解決問題。

回答

1

我大多的Winodws運行curl,但來自卷邊文檔下面應該工作:

If you're using the curl command line tool, you can specify your own CA cert path by setting the environment variable CURL_CA_BUNDLE to the path of your choice.

然後從http://curl.haxx.se/ca/cacert.pem下載最新.pem文件放置.pem在您在CURL_CA_BUNDLE環境指定的目錄路徑變量。對於環境變量是指向文件還是目錄,文檔有點含糊。我會嘗試將它指向該文件。

在Windows上,curlcurl可執行程序所在的相同目錄中查找.pem文件作爲文件curl-ca-bundle.crt。這也可能奏效。我在家裏有一個老MAC。我會在今晚稍後測試。

curl-config --ca對我而言返回/usr/share/curl/curl-ca-bundle.crt

我剛剛注意到有一個MacPort for curl-ca-bundle。對不起,可能是簡單的問題,但你安裝捲曲還是預裝?您可能需要考慮安裝MacPorts,然後使用MacPorts安裝curl-ca-bundle,但快速查看此MacPort的Portfile似乎只是將該軟件包放到/ usr/share中,您也可以手動執行此操作。

我從Macports安裝了curl,現在我已安裝7.27.0版本,並且配置爲使用最新的curl-ca-bundle.crt文件。請看下圖:

sams-mac:~ sam$ curl --version 
curl 7.27.0 (powerpc-apple-darwin8.11.0) libcurl/7.27.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

sams-mac:~ sam$ curl-config --ca 
/opt/local/share/curl/curl-ca-bundle.crt 

sams-mac:~ sam$ ls -l /opt/local/bin/curl* 
-rwxr-xr-x 1 root admin 147012 Aug 3 11:00 /opt/local/bin/curl 
-rwxr-xr-x 1 root admin 4988 Aug 3 11:00 /opt/local/bin/curl-config 
sams-mac:~ sam$ 
+0

我試過了,導出的CURL_CA_BUNDLE路徑,重新啓動我的機器,我仍然得到一個空行,當我運行'捲曲配置--ca'。任何其他想法? – 2012-08-01 19:43:36

+0

如果你運行'curl --verbose -o null https:// github.com/mxcl/homebrew.git/info/refs' – HeatfanJohn 2012-08-01 21:04:07

+0

'curl-config --ca'返回'/ usr/share/curl/curl-ca-bundle.crt'。 – HeatfanJohn 2012-08-02 11:46:11