微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么卷曲到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参数不会阻止详细输出.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐