为什么卷曲到https无法正常工作

前端之家收集整理的这篇文章主要介绍了为什么卷曲到https无法正常工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我可以毫无问题地做到以下几点:
curl -u "username:password" http://www.example.com/exportfile.xml

但是,如果我尝试对我们网站的https版本使用相同的命令,则会失败

curl -u "username:password" https://www.example.com/exportfile.xml

这是错误消息的样子:

About to connect() to www.example.com port 443 (#0)
Trying "some ip"... connected
Connected to www.example.com (some ip) port 443 (#0)
Initializing NSS with certpath: sql:/etc/pki/nssdb
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
NSS error -5938
Closing connection #0
SSL connect error
curl: (35) SSL connect error

所有帮助表示赞赏

解决方法

尝试使用-k / – insecure参数.

从手册页:

(SSL) This option explicitly allows curl to perform “insecure” SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered “insecure” fail unless -k,--insecure is used.

$curl -sku "username:password" "https://www.example.com/exportfile.xml"

我总是喜欢使用-s / – silent参数,除非我正在下载某些内容并希望查看统计信息.

另请注意,使用-s参数时,使用-s参数不会阻止详细输出.

原文链接:https://www.f2er.com/linux/398607.html

猜你在找的Linux相关文章