**已关闭。**此问题为not about programming or software development。目前不接受答复。
这个问题似乎不是关于a specific programming problem, a software algorithm, or software tools primarily used by programmers的。如果你认为这个问题与another Stack Exchange site的主题有关,你可以留下评论,解释在哪里可以回答这个问题。
4个月前关闭。
Improve this question
我在windows cmd中使用如下curl命令。
curl -v https://golang.org/dl/?mode=json
* Trying 142.250.9.141:443...
* TCP_NODELAY set
* Connected to golang.org (142.250.9.141) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: C:\Users\XXXXXX
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: self signed certificate in certificate chain
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
CAfile显示为无。但是我已经为相同的设置了User环境变量。
CAfile=C:\Users\xxxxx\cacert.pem
当我尝试在pem或cer文件的curl命令中添加--cafile时,它也会起作用。
我添加了cer和crt格式,但这是同一个问题。我用的是curl版本7.68.0
curl -V
curl 7.68.0 (x86_64-pc-win32) libcurl/7.68.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.40.0
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP brotli libz
花了一些时间研究其他相关的帖子,但仍然与同样的问题斗争。在Windows 10中包含CAfile的任何输入(cmd)。
1条答案
按热度按时间7eumitmz1#
CAfile显示为无。但是我已经为相同的设置了User环境变量。
当我尝试在pem或cer文件的curl命令中添加--cafile时,它也会起作用。
curl既没有
CAfile
环境变量,也没有--cafile
命令行参数。记录的内容:--cacert
(TLS)告诉curl使用指定的证书文件来验证对等方。文件可能包含多个CA证书。...
如果设置了名为**'CURL_CA_BUNDLE'**的环境变量,curl将识别该环境变量,并使用给定路径作为CA证书包的路径。此选项覆盖该变量。