curl: (51)Unable to communicate securely with peer
最近公司做的项目需要联通另一个系统,对方给了个token,测试一下该token是否有效,因为是在Linux上,没有postman,只能通过curl命令发送网络请求,但是实际测试时,由于服务器上有些库的版本比较低,出现各种问题,写篇文章记录一下。 如图: 首先第一个报错,400 bad request 这个好解决,按报错信息把http改为https就好了,但是改为https之后就出现第二个报错
curl: (51) Unable to communicate securely with peer: requested domain name does not match the servers certificate
网上搜了一下,基本上都是这篇,翻译也不翻译一下。。。 文中第一个方法没看懂,试了第二个方法,也就是图中圈出来的部分,在curl后面加上–insecure,通了,效果如图: 那么–insecure是干什么用的呢,在cmd中输入curl -help就是图中圈出来的部分,大意就是使用SSL时允许不安全的服务器连接。