修复纯HTTPS协议下的UCenter通信失败问题
This commit is contained in:
parent
37befaf4eb
commit
25a605f457
|
@ -747,7 +747,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $
|
|||
$scheme = $matches['scheme'];
|
||||
$host = $matches['host'];
|
||||
$path = $matches['path'] ? $matches['path'].(isset($matches['query']) && $matches['query'] ? '?'.$matches['query'] : '') : '/';
|
||||
$port = !empty($matches['port']) ? $matches['port'] : 80;
|
||||
$port = !empty($matches['port']) ? $matches['port'] : ($matches['scheme'] == 'https' ? 443 : 80);
|
||||
|
||||
if($post) {
|
||||
$out = "POST $path HTTP/1.0\r\n";
|
||||
|
@ -773,7 +773,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $
|
|||
}
|
||||
|
||||
$fpflag = 0;
|
||||
if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
|
||||
if(!$fp = @fsocketopen(($scheme == 'https' ? 'ssl' : $scheme).'://'.($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout)) {
|
||||
$context = array(
|
||||
'http' => array(
|
||||
'method' => $post ? 'POST' : 'GET',
|
||||
|
@ -783,7 +783,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $
|
|||
),
|
||||
);
|
||||
$context = stream_context_create($context);
|
||||
$fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context);
|
||||
$fp = @fopen($scheme.'://'.($scheme == 'https' ? $host : ($ip ? $ip : $host)).':'.$port.$path, 'b', false, $context);
|
||||
$fpflag = 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue