mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
correct docblock
invalid certificate domain
This commit is contained in:
parent
6e66815d67
commit
91907b5c6c
2 changed files with 20 additions and 1 deletions
|
@ -544,7 +544,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* ));
|
||||
* }}}
|
||||
*
|
||||
* @param string $field The name of the field from which the rule will be removed
|
||||
* @param string $field The name of the field where the rule is to be added
|
||||
* @param string|array|CakeValidationSet $name name of the rule to be added or list of rules for the field
|
||||
* @param array|CakeValidationRule $rule or list of rules to be added to the field's rule set
|
||||
* @return ModelValidator this instance
|
||||
|
|
|
@ -1736,6 +1736,25 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$this->assertArrayNotHasKey('ssl_verify_depth', $this->Socket->config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that requests fail when peer verification fails.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testVerifyPeer() {
|
||||
$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
|
||||
$socket = new HttpSocket();
|
||||
try {
|
||||
$socket->get('https://tv.eurosport.com/');
|
||||
$this->markTestSkipped('Found valid certificate, was expecting invalid certificate.');
|
||||
} catch (SocketException $e) {
|
||||
$message = $e->getMessage();
|
||||
$this->skipIf(strpos($message, 'Invalid HTTP') !== false, 'Invalid HTTP Response received, skipping.');
|
||||
$this->assertContains('Peer certificate CN', $message);
|
||||
$this->assertContains('Failed to enable crypto', $message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for status codes.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue