爱黑武论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9353|回复: 1

[网站技术] Discuz! X3.4 开启 https 后 UC 通信失败解决方案

[复制链接]
发表于 2020-10-29 01:54 | 显示全部楼层 |阅读模式
修改UC的 model/misc.php 文件,在第68行下方写入代码即可解决。

第68行代码为:
  1. $port = !empty($matches['port']) ? $matches['port'] : ($matches['scheme'] == 'https' ? 443 : 80);
复制代码


在上面这行代码下面写入:
  1. if(substr($url,0,5)=='https'){
  2. $ch = curl_init($url);
  3. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  4. if($post){
  5. curl_setopt($ch, CURLOPT_POST, 1);
  6. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  7. }
  8. if($cookie){
  9. curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  10. }
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  12. return curl_exec($ch);
  13. }
复制代码


保存后,将 misc.php 替换掉服务器上的文件,再进后台查看,通信就正常了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|爱黑武论坛 ( 京ICP备2023028323号 | 京公网安备11011202000270号 )

GMT+8, 2026-10-31 00:05 , Processed in 0.035976 second(s), 5 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2026, ihei5.com

快速回复 返回顶部 返回列表