项目配置好了https ,同时也配置了 301 重定向 从http跳转https ,会导致ucenter通信失败,解决办法如下
将下面代码 添加到:uc_server/model/misc.php 位置 69 行
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_VERIFYPEER, FALSE); return curl_exec($ch); }
转载请注明:有客帮 » ucenter https通信失败解决方法