curl - 'curl' 默认使用什么证书?

标签 curl certificate

“curl”默认使用哪些证书?

例子:

curl -I -L https://cruises.webjet.com.au

在 Ubuntu 15.04 上失败
curl: (60) SSL certificate problem: unable to get local issuer certificate

但是当我添加根证书(见 https://www.ssllabs.com/ssltest/analyze.html?d=cruises.webjet.com.au&latest )并运行时
curl -I -L --cacert downlaodedCert.pem https://cruises.webjet.com.au

一切安好。所以我猜'curl'默认不使用这个根证书。

但是我怎么能看到它使用了哪些证书呢?

最佳答案

curl 使用自己的 ca 证书包。

所以通常你需要添加受信任的服务器,这样做的一种方法是你所做的。例如,如果您使用 Firefox,另一种方法是 certutil

You can also extract the ca certs off your Firefox installation, if you just have the 'certutil' tool installed and run the firefox-db2pem.sh script!



希望你觉得这些信息有帮助:)

注意:该脚本是一个 shell 脚本,所以如果你在 windows 上使用它会有点复杂。可能仍然可以使用 msys 或 cygwin。但到那时,它开始变得比它可能值得的工作更多。

关于curl - 'curl' 默认使用什么证书?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30862216/

相关文章:

php - 使用 Curl -PHP 登录远程 url

curl - Tor & curl ​​: Can't complete SOCKS5 connection to 0. 0.0.0:0

php - Symfony2 应用程序速度慢

android - Chrome For Android - 如何拦截证书选择

IOS 一次登录多个开发者证书/一个Apple ID/一台开发机

perl - 你如何验证服务器证书和链中的每个证书直到 perl 中的 ROOT - 4 级深

php - 为什么 PHP cURL 可以执行请求,而 jQuery AJAX 却不能?

linux - Curl 作为 REST 服务器

c++ - 从可执行文件中读取和验证证书

java - 代表 Android 应用程序签名 key 、 keystore 实体以及该 key 中到底存储了什么?