]> _ Git - cubist_net.git/commitdiff
#7868 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Feb 2026 11:48:35 +0000 (12:48 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Feb 2026 11:48:35 +0000 (12:48 +0100)
src/HTTP.php

index 2d90e2b00d816b210f3df8a75ac090ed702e95eb..049441af4b4b44c7d524145f82982a556b901ca1 100644 (file)
@@ -42,7 +42,7 @@ class HTTP
 
         $flaresolverrCodes = [401, 403, 622];
 
-        if ($flaresolverr && in_array($res['http_code'], $flaresolverrCodes) /*&& in_array('cloudflare', $response->getHeader('Server'))*/) {
+        if ($flaresolverr && in_array($res['http_code'], $flaresolverrCodes)) {
             try {
                 $cloudflareRes = self::getHttpCodeCloudflare($url, $flaresolverr, $timeout);
                 if ($cloudflareRes) {
@@ -68,7 +68,10 @@ class HTTP
         $map = ['GuzzleHttp\Exception\ConnectException' => 622,
             'GuzzleHttp\Psr7\Exception\MalformedUriException' => 600];
         $messageMap = ['Undefined array key "solution"' => 603];
-        $startMap = ['cURL error 60: SSL: no alternative certificate subject name matches target host name' => 695];
+        $startMap = [
+            'cURL error 60: SSL: no alternative certificate subject name matches target host name' => 695,
+            'cURL error 60: SSL certificate problem: self-signed certificate' => 696,
+        ];
 
         $exceptionClass = get_class($e);
         $message = $e->getMessage();
@@ -131,6 +134,9 @@ class HTTP
         $response = self::_request($apiUrl, $timeout, 'POST', ['json' => $payload, 'headers' => ['Content-Type' => 'application/json']], false);
         $body = json_decode($response->getBody(), true);
         $httpcode = $body['solution']['status'];
+        if ($body['message'] == 'Challenge not detected!') {
+            return false;
+        }
 
         if (self::$_cookiesJar && isset($body['solution']['cookies'])) {
             foreach ($body['solution']['cookies'] as $cookie) {