diff --git a/library/Requests/Transport/fsockopen.php b/library/Requests/Transport/fsockopen.php index c7c61d3b1..7972c265e 100644 --- a/library/Requests/Transport/fsockopen.php +++ b/library/Requests/Transport/fsockopen.php @@ -92,6 +92,8 @@ public function request($url, $headers = array(), $data = array(), $options = ar if (isset($options['verify'])) { if ($options['verify'] === false) { $context_options['verify_peer'] = false; + $context_options['verify_peer_name'] = false; + $verifyname = false; } elseif (is_string($options['verify'])) { $context_options['cafile'] = $options['verify']; diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index ebd6ca98a..7103e1f34 100644 --- a/tests/Transport/Base.php +++ b/tests/Transport/Base.php @@ -567,6 +567,16 @@ public function testBadDomain() { $request = Requests::head('https://wrong.host.badssl.com/', array(), $this->getOptions()); } + public function testBadDomainNoVerify() { + if ($this->skip_https) { + $this->markTestSkipped('SSL support is not available.'); + return; + } + + $response = Requests::head('https://wrong.host.badssl.com/', array(), $this->getOptions(array('verify' => false))); + $this->assertTrue($response->success); + } + /** * Test that the transport supports Server Name Indication with HTTPS *