本文介绍了无法通过curl访问github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 尝试使用以下命令访问github失败,验证失败错误。我应该如何处理此问题 C:\software\curl-7.23.1-win64-ssl-sspi> ; curl -i https://api.github.com curl:(60)SSL证书问题,请验证CA证书是否正确。详细信息:错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败更多详细信息:http://curl.haxx.se/docs/sslcerts.html curl默认情况下使用证书颁发机构(CA)公钥(CA证书)的捆绑执行SSL证书验证。如果默认的 bundle文件不足,您可以使用--cacert选项指定一个备用文件。 如果此HTTPS服务器使用由表示的CA签署的证书,则证书验证可能失败,原因是证书的问题(可能已过期,或者名称可能与网址中的域名不匹配)。 如果要禁用curl对证书的验证,请使用-k(或 - 不安全)选项。 解决方案使用msysgit,我有时必须再次指定 http.sslcainfo 为msysgit正确选择正确的CA证书文件。 git config --system http.sslcainfo \bin / curl-ca-bundle.crt 此处显示,并在 注释) 如果此不工作: 尝试指定完整路径: git config --system http.sslcainfo / c /path/to/msysgit/bin/curl-ca-bundle.crt ,如此博文: 其他选项详见 HTTPS github access Trying to access github using the following command fails with the verification failed error. What should I do get past this issueC:\software\curl-7.23.1-win64-ssl-sspi>curl -i https://api.github.comcurl: (60) SSL certificate problem, verify that the CA cert is OK. Details:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failedMore details here: http://curl.haxx.se/docs/sslcerts.htmlcurl performs SSL certificate verification by default, using a "bundle"of Certificate Authority (CA) public keys (CA certs). If the defaultbundle file isn't adequate, you can specify an alternate fileusing the --cacert option.If this HTTPS server uses a certificate signed by a CA represented inthe bundle, the certificate verification probably failed due to aproblem with the certificate (it might be expired, or the name mightnot 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. 解决方案 With msysgit, I sometime have to specify again http.sslcainfo for msysgit to correctly pick up the right CA cert file. git config --system http.sslcainfo \bin/curl-ca-bundle.crt(Also presented here and in the comments of the GitHub smart http page)If this doesn't work:try to specify the full path: git config --system http.sslcainfo /c/path/to/msysgit/bin/curl-ca-bundle.crt, as illustrated by this blog post:$ git config --global http.sslcainfo "/c/Program Files (x86)/Git/bin/curl-ca-bundle.crt"other alternatives are detailed in "HTTPS github access" 这篇关于无法通过curl访问github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-05 09:33