加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 16:47:03 所属栏目:Linux 来源:网络整理
导读:我可以毫无问题地做到以下几点: curl -u "username:password" http://www.example.com/exportfile.xml 但是,如果我尝试对我们网站的https版本使用相同的命令,则会失败 curl -u "username:password" https://www.example.com/exportfile.xml 这是错误消息的
我可以毫无问题地做到以下几点:
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参数不会阻止详细输出.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读