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

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...