EduSoho

EduSoho 开启https SSL证书协议后与UCenter

2018-09-17  本文已影响1人  d69813c23b85

今天一个客户更换域名后UCenter通讯失败,以为是域名的问题,通过排查发现是开启了HTTPS协议原来没有开启,而UCenter默认没有对HTTPS协议进行读取,所以在抓取数据的时候回抓到错误地址,导致手动复制返回值正确UC却失败,解决方法就是如下

[图片上传失败...(image-9d24c2-1537171011837)]

uc_server/model/misc.php Line 62 function dfopen(){}

$host = $matches['host'];
$path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/';
$port = !empty($matches['port']) ? $matches['port'] : 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_VERIFYPEER, FALSE);
  return curl_exec($ch);
}
EduSoho 与 UCenter通讯通讯会员同步
091500523083_0e2349e1a247fc3682_1.png 091500523083_0e2349e1a247fc3682_2.png 091500523083_0e2349e1a247fc3682_3.png 091500523083_0e2349e1a247fc3682_4.png 091500523083_0e2349e1a247fc3682_5.png 091500523083_0e2349e1a247fc3682_6.png
上一篇下一篇

猜你喜欢

热点阅读