mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added SSL support for Socket
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5934 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
cf449b14dd
commit
58517b34b0
1 changed files with 7 additions and 2 deletions
|
@ -113,12 +113,17 @@ class CakeSocket extends Object {
|
|||
if ($this->connection != null) {
|
||||
$this->disconnect();
|
||||
}
|
||||
|
||||
$scheme = null;
|
||||
if (isset($this->config['request']) && $this->config['request']['uri']['scheme'] == 'https') {
|
||||
$scheme = 'ssl://';
|
||||
}
|
||||
|
||||
if ($this->config['persistent'] == true) {
|
||||
$tmp = null;
|
||||
$this->connection = @pfsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
|
||||
$this->connection = @pfsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
|
||||
} else {
|
||||
$this->connection = fsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
|
||||
$this->connection = fsockopen($scheme.$this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
|
||||
}
|
||||
|
||||
if (!empty($errNum) || !empty($errStr)) {
|
||||
|
|
Loading…
Reference in a new issue