mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Support for SSL Server Name Indication
This commit is contained in:
parent
23d4d1155a
commit
9e6b1b6930
1 changed files with 14 additions and 0 deletions
|
@ -718,6 +718,20 @@ class HttpSocket extends CakeSocket {
|
|||
}
|
||||
unset($this->config[$key]);
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.3.2', '>=')) {
|
||||
if (empty($this->config['context']['ssl']['SNI_enabled'])) {
|
||||
$this->config['context']['ssl']['SNI_enabled'] = true;
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
|
||||
if (empty($this->config['context']['ssl']['peer_name'])) {
|
||||
$this->config['context']['ssl']['peer_name'] = $this->request['uri']['host'];
|
||||
}
|
||||
} else {
|
||||
if (empty($this->config['context']['ssl']['SNI_server_name'])) {
|
||||
$this->config['context']['ssl']['SNI_server_name'] = $this->request['uri']['host'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($this->config['context']['ssl']['cafile'])) {
|
||||
$this->config['context']['ssl']['cafile'] = CAKE . 'Config' . DS . 'cacert.pem';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue