crx349 发表于 2025-4-10 00:39:20

Discuz!x3.2 启用https后uc通信失败解决一例

老站用x3.2还是很多,今天就有客户问启用了https后uc就通信失败了,刚好解决~分享下


uc_server/model/misc.php

搜索
$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_VERIFYHOST, FALSE);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
            return curl_exec($ch);
                }

保存,更新uc缓存,解决
页: [1]
查看完整版本: Discuz!x3.2 启用https后uc通信失败解决一例