curl、wget请求https不进行SSL证书验证

curl请求https的时候遇到了报错60,说是SSL证书问题,无法获取本地颁发者证书。给出的解决方法是导入证书,但感觉太麻烦。既然验证不了,那就不验证了,于是就找到了忽略验证证书的办法。

具体报错是这样

curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

解决也很简单,执行curl加上参数-k,执行wget加上参数–no-check-certificate。例如:

curl -k https://t.for-get.com/
wget --no-check-certificate https://t.for-get.com/

 

这里要填写昵称

这是一个很懒的作者,请善待他。

留下你的评论

*评论支持代码高亮<pre class="prettyprint linenums">代码</pre>

相关推荐