2012-02-13 18 views
3

次のコマンドを使用してgithubにアクセスしようとすると、検証に失敗したエラーが発生して失敗します。私はこの問題msysgitでカール経由でgithubにアクセスできない

C:\software\curl-7.23.1-win64-ssl-sspi>curl -i https://api.github.com 

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. 

答えて

2

過ぎて何を得るのですかなければならない、私はいつかmsysgitが正しく右のCA証明書ファイルをピックアップするために再度http.sslcainfoを指定する必要があります。

git config --system http.sslcainfo \bin/curl-ca-bundle.crt 

(またpresented herecomments of the GitHub smart http page中)
これは動作しない場合:このblog postによって示されるように、git config --system http.sslcainfo /c/path/to/msysgit/bin/curl-ca-bundle.crt

  • は、フルパスを指定しよう

もっと簡単に修正するには、http.sslcainfoをの絶対パスに設定するだけです私は設定が将来msysGitのインストールによって上書きされることはありませんので--globalレベルでこれを行うことにしました

$ git config --global http.sslcainfo "/c/Program Files (x86)/Git/bin/curl-ca-bundle.crt" 

:あなたのmsysGitのインストールbinフォルダ内のファイル。あなたは--cacertオプション(なぜ?)を使用したくない場合は

2

に詳述されている、テキストで提案されているように、-kについて別の提案を使用します

>curl -i -k https://api.github.com 
HTTP/1.1 302 Found 
Server: nginx/1.0.4 
Date: Mon, 13 Feb 2012 09:14:24 GMT 
Content-Type: text/html;charset=utf-8 
Connection: keep-alive 
Status: 302 Found 
X-RateLimit-Limit: 5000 
ETag: "d41d8cd98f00b204e9800998ecf8427e" 
Location: http://developer.github.com 
X-RateLimit-Remaining: 4999 
Content-Length: 0 
+0

**注意:**このオプションは、SSL証明書の検証を無効にします。 --cacertが好ましい方法です。 –

+0

GitHUbアクセスにcURLを使用すると、SSLがいくらか冗長化されます。リダイレクトにも '-Lk'フラグを使用してください。 – not2qubit

関連する問題