【发布时间】:2020-01-31 04:07:54
【问题描述】:
当我使用“curl -v https://hostname/resource.xml”时,出现以下错误:
About to connect() to hostname.com port 443 (#0)
Trying x.x.x.x... connected
Connected to hostname.com (x.x.x.x) port 443 (#0)
Initializing NSS with certpath: sql:/etc/pki/nssdb
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
Peer's certificate issuer is not recognized: 'CN=InCommon RSA Server CA,OU=InCommon,O=Internet2,L=Ann Arbor,ST=MI,C=US'
NSS error -8179
Closing connection #0
Peer certificate cannot be authenticated with known CA certificates
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html
但是,当我尝试:“curl -v https://google.com/” 一切正常!
验证网站的证书位于 /etc/ssl/certs
我可以假设这是 SSL 证书和验证的问题,因为当我使用 -k 运行 curl 命令时它可以工作!
我已尝试以下方法进行故障排除:
- 确认服务器上的日期/时间正确
- 更新了 cacert.pem 证书(来源:cURL error 60: SSL certificate: unable to get local issuer certificate)
- 确认 Apache 配置正确
- 尝试将 SSL 证书 (website.crt) 添加到 /etc/pki/tls
我正在跑步:
- CentOS 6.10 版(最终版)
- curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
- PHP 7.1.32 (cli)
会不会是 SSLCertificateChain 不完整造成的?
感谢您的帮助!
【问题讨论】:
标签: ssl curl openssl ssl-certificate centos6