禁用curl SSL证书验证

Mic*_*ky 7 ssl curl ssl-certificate

您好我想为网站使用API​​,但我的curl命令出错.

我想禁用 SSL证书验证.

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.
Run Code Online (Sandbox Code Playgroud)

Gil*_*not 24

只需-k在网址之前的某处添加交换机即可

man curl | less +/--insecure
Run Code Online (Sandbox Code Playgroud)

-k,--insecure(TLS)默认情况下,验证每个SSL连接卷曲都是安全的.此选项允许curl继续运行,即使对于服务器连接也是如此,否则会被认为是不安全的.

通过确保服务器的证书包含正确的名称并使用证书存储区成功验证来验证服务器连接.

有关更多详细信息,请参阅此在线资源:https: //curl.haxx.se/docs/sslcerts.html

另请参阅--proxy-insecure和--cacert

  • less选项解释:+表示执行命令。`/` 是搜索命令。`--insecure` 是要搜索的文本。 (5认同)
  • 使用 man 和 less 构建命令的方式非常酷! (3认同)