gpt4 book ai didi

curl - 无法通过 curl 访问 github

转载 作者:行者123 更新时间:2023-12-04 03:29:04 24 4
gpt4 key购买 nike

尝试使用以下命令访问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.

最佳答案

使用 msysgit,有时我必须再次指定 http.sslcainfo 以便 msysgit 正确获取正确的 CA 证书文件。

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

(还有presented herecomments of the GitHub smart http page)
如果这不起作用:

  • 尝试指定完整路径:git config --system http.sslcainfo/c/path/to/msysgit/bin/curl-ca-bundle.crt,如 blog post 所示:

A much easier fix is just to set http.sslcainfo to the absolute path of the curl-ca-bundle.crt file in your msysGit install’s bin folder:

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

I chose to do this at the --global level so the setting won’t be overwritten by future msysGit installs.

关于curl - 无法通过 curl 访问 github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9257708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com