Skip to content
Permalink
Browse files

Add test for Self-signed certificates

  • Loading branch information...
Iandenh committed Oct 2, 2015
1 parent 5c722c6 commit bb7e7850ae6205c2d474cfc534efc1ec8e10cfe3
Showing with 13 additions and 0 deletions.
  1. +1 −0 lib/Cake/Network/CakeSocket.php
  2. +12 −0 lib/Cake/Test/Case/Network/CakeSocketTest.php
@@ -410,6 +410,7 @@ public function enableCrypto($type, $clientOrServer = 'client', $enable = true)
* 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 enableSelfSigned() {
@@ -349,6 +349,18 @@ public function testEnableCryptoEnableStatus() {
$this->assertTrue($this->Socket->encrypted);
}
/**
* testEnableCryptoSelfSigned
*
* @return void
*/
public function testEnableCryptoSelfSigned() {
$this->_connectSocketToSslTls();
$this->assertTrue($this->Socket->enableSelfSigned());
$this->assertTrue($this->Socket->enableCrypto('tls', 'client'));
$this->Socket->disconnect();
}
/**
* test getting the context for a socket.
*

0 comments on commit bb7e785

Please sign in to comment.
You can’t perform that action at this time.