php curl请求https 返回无结果|false|errno:35

1 SSL: certificate subject name 'WMSvc-GWAMSERVER02' does not match target host name 

   把curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

2 Curl error: SSL certificate problem: self signed certificate in certificat

   这个是CURLOPT_SSL_VERIFYHOST 设为1引起,不同版本的libcurl对curl的CURLOPT_SSL_VERIFYHOST有影响

先在mac下,然后centos7下libcurl版本7.4以上 出现类似问题 

解决方案

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

2 降低libcurl版本 到7.4下

wget http://curl.haxx.se/download/curl-7.38.0.tar.gz
tar xzvf curl-7.38.0.tar.gz
cd curl-7.38.0/
./configure
486 make && make install

 

 

posted @ 2017-08-02 14:31  jking10  阅读(1780)  评论(0编辑  收藏  举报