ssl_verify_host option in config (default is true)
This commit is contained in:
parent
5c7ad2e031
commit
964d13792b
@ -345,7 +345,8 @@ $default =
|
|||||||
'maxurllength' => 100,
|
'maxurllength' => 100,
|
||||||
'maxnoticelength' => -1),
|
'maxnoticelength' => -1),
|
||||||
'http' => // HTTP client settings when contacting other sites
|
'http' => // HTTP client settings when contacting other sites
|
||||||
array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt')
|
array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt') (this activates "ssl_verify_peer")
|
||||||
|
'ssl_verify_host' => true, // HTTPRequest2 makes sure this is set to CURLOPT_SSL_VERIFYHOST==2 if using curl
|
||||||
'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
|
'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
|
||||||
'proxy_host' => null,
|
'proxy_host' => null,
|
||||||
'proxy_port' => null,
|
'proxy_port' => null,
|
||||||
|
@ -145,6 +145,10 @@ class HTTPClient extends HTTP_Request2
|
|||||||
$this->config['ssl_verify_peer'] = false;
|
$this->config['ssl_verify_peer'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This means "verify the cert hostname against what we connect to", it does not
|
||||||
|
// imply CA trust or anything like that. Just the hostname.
|
||||||
|
$this->config['ssl_verify_host'] = common_config('http', 'ssl_verify_host');
|
||||||
|
|
||||||
if (common_config('http', 'curl') && extension_loaded('curl')) {
|
if (common_config('http', 'curl') && extension_loaded('curl')) {
|
||||||
$this->config['adapter'] = 'HTTP_Request2_Adapter_Curl';
|
$this->config['adapter'] = 'HTTP_Request2_Adapter_Curl';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user