无限星辰工作室-客户无限互联网动力之源

标题: Discuz!x3.2 启用https后uc通信失败解决一例 [打印本页]

作者: crx349    时间: 3 天前
标题: Discuz!x3.2 启用https后uc通信失败解决一例
老站用x3.2还是很多,今天就有客户问启用了https后uc就通信失败了,刚好解决~分享下


uc_server/model/misc.php

搜索
  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_VERIFYHOST, FALSE);
  12.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  13.             return curl_exec($ch);
  14.                 }
复制代码


保存,更新uc缓存,解决




欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/) Powered by Discuz! X3.4