diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index c8b3b9fe9f92..41c6eca958b1 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -559,6 +559,10 @@ protected function setCURLOptions(array $curlOptions = [], array $config = []) $curlOptions[CURLOPT_SSL_VERIFYPEER] = 1; } elseif (is_bool($config['verify'])) { $curlOptions[CURLOPT_SSL_VERIFYPEER] = $config['verify']; + + if ($config['verify'] === FALSE) { + $curlOptions[CURLOPT_SSL_VERIFYHOST] = 0; + } } } diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php index 186284da6ba6..25a8c30669d0 100644 --- a/tests/system/HTTP/CURLRequestTest.php +++ b/tests/system/HTTP/CURLRequestTest.php @@ -529,6 +529,9 @@ public function testSSLVerification(): void $this->assertArrayHasKey(CURLOPT_SSL_VERIFYPEER, $options); $this->assertSame(1, $options[CURLOPT_SSL_VERIFYPEER]); + + $this->assertArrayHasKey(CURLOPT_SSL_VERIFYHOST, $options); + $this->assertSame(2, $options[CURLOPT_SSL_VERIFYHOST]); } public function testSSLWithBadKey(): void