curl支持ssl报错:SSL certificate problem: unable to get local issuer certificate

curl支持ssl报错:SSL certificate problem: unable to get local issuer certificatecurl 去访问 https 的站点报错 curl vhttps www baidu com SSLv3 TLShandshake Clienthello 1 SSLv3 TLShandshake Serverhello 2 SSLv3 TLShandshake CERT 11 SSLv3 TLSalert Serverhello

curl去访问https的站点报错:

curl -v https://www.baidu.com
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

看了一下curl是支持ssl的

curl -V curl 7.29.0 (mipsel-openwrt-linux-gnu) libcurl/7.29.0 OpenSSL/1.0.1e zlib/1.2.7 Protocols: file ftp ftps http https imap imaps pop3 pop3s rtsp smtp smtps tftp Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

curl的命令也是支持的

curl -h|grep ssl --ftp-ssl-ccc Send CCC after authenticating (F) --ftp-ssl-ccc-mode ACTIVE/PASSIVE Set CCC mode (F) --ftp-ssl-control Require SSL/TLS for ftp login, clear for transfer (F) --ssl Try SSL/TLS (FTP, IMAP, POP3, SMTP) --ssl-reqd Require SSL/TLS (FTP, IMAP, POP3, SMTP) -2, --sslv2 Use SSLv2 (SSL) -3, --sslv3 Use SSLv3 (SSL) --ssl-allow-beast Allow security flaw to improve interop (SSL) 
http://curl.haxx.se/docs/sslcerts.html

找到证书下载地址:

https://curl.haxx.se/ca/cacert.pem 

下载成功后,放到板子上,我是放在这个路径下了

/etc/curlssl/cacert.pem 

然后配置到环境变量

export CURL_CA_BUNDLE=/etc/curlssl/cacert.pem 

然后访问下百度:

curl -v https://www.baidu.com
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.baidu.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Connection: Keep-Alive
< Content-Length: 2443
< Content-Type: text/html
< Date: Mon, 25 Mar 2019 03:18:39 GMT
< Etag: "588603ec-98b"
< Last-Modified: Mon, 23 Jan 2017 13:23:56 GMT
< Pragma: no-cache
< Server: bfe/1.0.8.18
< Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
< 


  
  
  
  
  
  
   
   
    
     
      
      百度一下,你就知道 
      

关于百度 About Baidu

©2017 Baidu 使用百度前必读  意见反馈 京ICP证030173号  curl支持ssl报错:SSL certificate problem: unable to get local issuer certificate

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

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/221376.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午6:15
下一篇 2026年3月17日 下午6:16


相关推荐

  • AWK介绍[通俗易懂]

    AWK介绍[通俗易懂]0.awk有3个不同版本:awk、nawk和gawk,未作特别说明,一般指gawk。1.awk语言的最基本功能是在文件或字符串中基于指定规则来分解抽取信息,也可以基于指定的规则来输出数据。完整的awk脚本通常用来格式化文本文件中的信息。2.三种方式调用awk1)awk[opion]’awk_script’input_file1[input_file2…]

    2022年7月27日
    12
  • 猴子吃桃

    猴子吃桃猴子吃桃

    2022年4月24日
    49
  • Loadlibrary 失败的原因

    Loadlibrary 失败的原因  今天调试公司的游戏程序时,发现Loadlibrary总是调用失败,查看加载的动态库路径完全正确,为什么还是会加载失败呢?莫非是这个被加载的动态库本身有问题,我用工具查看了其依赖性,发现没问题,难道是该动态库依赖的动态库有问题?我继续查看该动态库依赖的动态库依赖性果然是这样。

    2022年7月13日
    20
  • 让王老吉崛起的三大营销战役「建议收藏」

    让王老吉崛起的三大营销战役「建议收藏」一个存在了百年的区域市场老品牌,在短短5年时间内崛起,迅速成长为具有全国影响力的饮料销售冠军,而且博得了良好的社会美誉,这其中有什么不为人知的营销实践?又有着怎样的成长秘诀?梳理王老吉的发展史,我们注意到,有三大营销战役决定了这个品牌的崛起。撷取这三次营销个案,不但可以让我们知道王老吉的崛起密码,还可以了解到网络营销、品牌定位、产品延伸等营销前沿思想的现实实践。一个“网络营销”的经典案例?如

    2025年7月27日
    6
  • 重定向和转发区别[通俗易懂]

    重定向和转发区别[通俗易懂]一、转发转发的原理,可以通过下图展示:浏览器的请求发送给组件1,组件1经过一些处理之后,将request和response对象“传递”给组件2,由组件2继续处理,然后输出响应(当然,也可以继续向其他组件“传递”),这个传递的过程称之为“转发”。整个过程只涉及一次浏览器和服务器之间的“请求-响应”,转发过程中的组件共享同一个请求(request)和响应(response)对象。转发的意义在于可以实现组件的**“分工”。**在基于MVC,多层结构的Web应用中,经常需要多个组件协同完成一次“请求

    2025年10月6日
    14
  • ideal2019 30天试用结束了,在线激活码【最新永久激活】

    (ideal2019 30天试用结束了,在线激活码)这是一篇idea技术相关文章,由全栈君为大家提供,主要知识点是关于2021JetBrains全家桶永久激活码的内容IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html2JTX0APX6F-eyJsa…

    2022年3月30日
    43

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号