修复纯HTTPS协议下的UCenter通信失败问题
This commit is contained in:
parent
7b8ce575cd
commit
def9b78e8c
|
@ -67,6 +67,13 @@ class miscmodel {
|
|||
$path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/';
|
||||
$port = !empty($matches['port']) ? $matches['port'] : 80;
|
||||
|
||||
if($scheme = 'https'){
|
||||
$scheme = 'ssl';
|
||||
if($port == 80){
|
||||
$port = 443;
|
||||
}
|
||||
}
|
||||
|
||||
if($post) {
|
||||
$out = "POST $path HTTP/1.0\r\n";
|
||||
$header = "Accept: */*\r\n";
|
||||
|
@ -92,7 +99,7 @@ class miscmodel {
|
|||
}
|
||||
|
||||
$fpflag = 0;
|
||||
if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
|
||||
if(!$fp = @fsocketopen($scheme.'://'.($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
|
||||
$context = array(
|
||||
'http' => array(
|
||||
'method' => $post ? 'POST' : 'GET',
|
||||
|
|
Loading…
Reference in New Issue