天天看點

ucenter 項目配置https後ucenter提示通信失敗

項目配置好了https ,同時也配置了 301 重定向  從http跳轉https ,會導緻ucenter通信失敗,解決辦法如下

将下面代碼 添加到:uc_server/model/misc.php 位置 69 行

/*=========================================================== */
		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);
		}
		/*=========================================================================================== */
           

完成後如圖所示:

ucenter 項目配置https後ucenter提示通信失敗

原文連結 :http://joowhee.com/discuz-https-ucenter/