Solve the communication failure in UCENTER after HTTPS on discuz

今天尝试把discuz 进行了https处理,但是发现UCENTER里面显示通讯失败,找不到原因,最后发现ucenter无法识别。解决方法如下:

在uc_server/ model/misc.php内,找到

//error_log("[uc_server]\r\nurl: $url\r\npost: $post\r\n\r\n", 3, 'c:/log/php_fopen.txt');

在下面增加:

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);
}

This site Original article All followed" Attribution—NonCommercial—ShareAlike 4.0 (CC BY-NC-SA 4.0) ”。 Please keep the following marks for sharing and interpretation:

Original author: Jake Tao Source: 「解决discuz上HTTPS后UCENTER出现通讯失败」

Praise 401
0 0 401

Further reading

Post a reply

Log in can only be commented on later
Share this page
Back to top