Skip to content

Commit

Permalink
Remove allowSelfSigned() method.
Browse files Browse the repository at this point in the history
This method is no longer needed as the low level socket understands the
`ssl_*` options now.

Refs #7496
  • Loading branch information
markstory committed Oct 13, 2015
1 parent cc3531d commit 3a4facb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
12 changes: 0 additions & 12 deletions lib/Cake/Network/CakeSocket.php
Expand Up @@ -446,16 +446,4 @@ public function enableCrypto($type, $clientOrServer = 'client', $enable = true)
$this->setLastError(null, $errorMessage);
throw new SocketException($errorMessage);
}

/**
* Accept Self-signed certificate on current stream socket
*
* @return bool True on success
* @link http://php.net/manual/en/context.ssl.php About the 'allow_self_signed' option.
* @see stream_context_set_option
*/
public function allowSelfSigned() {
return stream_context_set_option($this->connection, 'ssl', 'allow_self_signed', true);
}
}

3 changes: 0 additions & 3 deletions lib/Cake/Network/Email/SmtpTransport.php
Expand Up @@ -169,9 +169,6 @@ protected function _connect() {
$this->_smtpSend("EHLO {$host}", '250');
if ($this->_config['tls']) {
$this->_smtpSend("STARTTLS", '220');
if ($this->_config['ssl_allow_self_signed']) {
$this->_socket->allowSelfSigned();
}
$this->_socket->enableCrypto('tls');
$this->_smtpSend("EHLO {$host}", '250');
}
Expand Down
12 changes: 0 additions & 12 deletions lib/Cake/Test/Case/Network/CakeSocketTest.php
Expand Up @@ -349,18 +349,6 @@ public function testEnableCryptoEnableStatus() {
$this->assertTrue($this->Socket->encrypted);
}

/**
* testEnableCryptoSelfSigned
*
* @return void
*/
public function testEnableCryptoSelfSigned() {
$this->_connectSocketToSslTls();
$this->assertTrue($this->Socket->allowSelfSigned());
$this->assertTrue($this->Socket->enableCrypto('tls', 'client'));
$this->Socket->disconnect();
}

/**
* test getting the context for a socket.
*
Expand Down

0 comments on commit 3a4facb

Please sign in to comment.