老站用x3.2还是很多,今天就有客户问启用了https后uc就通信失败了,刚好解决~分享下
uc_server/model/misc.php
搜索
- $port = !empty($matches['port']) ? $matches['port'] : ($matches['scheme'] == 'https' ? 443 : 80);
复制代码
下面加入
- if(substr($url,0,5)=='https'){
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- if($post){
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- if($cookie){
- curl_setopt($ch, CURLOPT_COOKIE, $cookie);
- }
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- return curl_exec($ch);
- }
复制代码
保存,更新uc缓存,解决 |