Skip to content
Snippets Groups Projects
Commit 2cdcef3c authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1528 from splitbrain/pull-request-1527

TLS fix for HTTPClient
parents abaeff3a c67b1dab
No related branches found
No related tags found
No related merge requests found
...@@ -272,13 +272,15 @@ class HTTPClient { ...@@ -272,13 +272,15 @@ class HTTPClient {
$server = $this->proxy_host; $server = $this->proxy_host;
$port = $this->proxy_port; $port = $this->proxy_port;
if (empty($port)) $port = 8080; if (empty($port)) $port = 8080;
$use_tls = $this->proxy_ssl;
}else{ }else{
$request_url = $path; $request_url = $path;
if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80; if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
$use_tls = ($uri['scheme'] == 'https');
} }
// add SSL stream prefix if needed - needs SSL support in PHP // add SSL stream prefix if needed - needs SSL support in PHP
if($port == 443 || $this->proxy_ssl) { if($use_tls) {
if(!in_array('ssl', stream_get_transports())) { if(!in_array('ssl', stream_get_transports())) {
$this->status = -200; $this->status = -200;
$this->error = 'This PHP version does not support SSL - cannot connect to server'; $this->error = 'This PHP version does not support SSL - cannot connect to server';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment