Skip to content

Commit

Permalink
Support for SSL Server Name Indication
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieB2B authored and markstory committed Mar 24, 2015
1 parent 23d4d11 commit 9e6b1b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Cake/Network/Http/HttpSocket.php
Expand Up @@ -718,6 +718,20 @@ protected function _configContext($host) {
}
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';
}
Expand Down

0 comments on commit 9e6b1b6

Please sign in to comment.