linux - curl - 禁止证书验证错误文本,而不是错误本身

标签 linux ssl curl certificate

每当我使用 curl 并收到错误 60(SSL 证书问题)时,它也会向我显示一大堆文字:

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.


我怎样才能只隐藏这堵文字墙?

最佳答案

如果您只想抑制警告,请使用以下标志:
-s, --silent
如果您想在证书问题的情况下连接到服务器,请使用以下标志:
-k(或--不安全)

关于linux - curl - 禁止证书验证错误文本,而不是错误本身,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69811984/

相关文章:

java - 在Tomcat上部署war文件

linux - Bash 脚本将带有空格分隔标记的字符串转换为数组

linux - 如何知道 Linux 中特定引脚的中断/GPIO 编号

ssl - 如何禁用 SSL 中的弱密码?

ssl - 是否可以在单个 SSL 证书的第二个标签中使用带有 `*` 的 SAN 条目的通配符

java - 无法找到我的 java 安装位置

java - 我的应用程序如何知道要使用哪个私钥

go - Heroku 托管应用程序上的 Webhook 未更新

php - 无法在 ubuntu 16.10 上再次安装 php5.6-curl。添加了ppa。

c++ - curl_easy_perform 返回 CURLE_WRITE_ERROR,但我不会写任何东西