mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Add test for Self-signed certificates
This commit is contained in:
parent
5c722c6665
commit
bb7e7850ae
2 changed files with 13 additions and 0 deletions
|
@ -410,6 +410,7 @@ class CakeSocket {
|
|||
* 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 @@ class CakeSocketTest extends CakeTestCase {
|
|||
$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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue