LouisLaw 发表于 2020-10-29 01:54

Discuz! X3.4 开启 https 后 UC 通信失败解决方案

修改UC的 model/misc.php 文件,在第68行下方写入代码即可解决。

第68行代码为:
$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_VERIFYPEER, FALSE);
return curl_exec($ch);
}

保存后,将 misc.php 替换掉服务器上的文件,再进后台查看,通信就正常了。
页: [1]
查看完整版本: Discuz! X3.4 开启 https 后 UC 通信失败解决方案