From 2cd5df41b6691d23373f9f8d8fdc49c8a27379b0 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Fri, 19 Jan 2024 15:04:16 +0000 Subject: [PATCH] http_ssl_verify_peer sets CURLOPT_SSL_VERIFYPEER correctly CURLOPT_SSL_VERIFYPEER is by default true. Set to false when http_ssl_verify_peer is false. --- src/HttpClient/HttpClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HttpClient/HttpClient.php b/src/HttpClient/HttpClient.php index 5c98fe7bf..779088d25 100644 --- a/src/HttpClient/HttpClient.php +++ b/src/HttpClient/HttpClient.php @@ -74,8 +74,8 @@ public function sendRequest(Request $request, Options $options): Response curl_setopt($curlHandle, \CURLOPT_HTTP_VERSION, \CURL_HTTP_VERSION_1_1); $httpSslVerifyPeer = $options->getHttpSslVerifyPeer(); - if ($httpSslVerifyPeer) { - curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, true); + if (!$httpSslVerifyPeer) { + curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, false); } $httpProxy = $options->getHttpProxy();