You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the HTTP::pool to access a site with an expired SSL cert, I was expecting a GuzzleHttp\Exception\RequestException to be returned, but instead we get a Illuminate\Http\Client\Response but it is missing the internal PSR response, so accessing any of the response details fails.
Steps To Reproduce:
use Illuminate\Http\Client\Pool;
use Illuminate\Support\Facades\Http;
$responses = Http::pool(fn (Pool $pool) => [
$pool->get('https://expired.badssl.com')
]);
$responses[0]->status();
I would expect the $response[0] to be a type of GuzzleHttp\Exception\RequestException but we get a valid looking Illuminate\Http\Client\Response
The call to ->status() results in an error because the Illuminate\Http\Client\Response internal PSR response property is null: Call to a member function getStatusCode() on null in ....
At present my solution to detect this failure is to check for a null return on the response->toPsrResponse() and then check for a non zero in the handlerStats ssl_verify_result, but this is fragile as it depends on using the curl supplied ssl_verify_result.
...
if ($responses[0]->toPsrResponse() === null && $responses[0]->handlerStats()['ssl_verify_result']) {
// SSL error occurred during request
}
Any help or pointers to more detail would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Description:
When using the HTTP::pool to access a site with an expired SSL cert, I was expecting a GuzzleHttp\Exception\RequestException to be returned, but instead we get a Illuminate\Http\Client\Response but it is missing the internal PSR response, so accessing any of the response details fails.
Steps To Reproduce:
I would expect the $response[0] to be a type of GuzzleHttp\Exception\RequestException but we get a valid looking Illuminate\Http\Client\Response
The call to ->status() results in an error because the Illuminate\Http\Client\Response internal PSR response property is null:
Call to a member function getStatusCode() on null in ....
At present my solution to detect this failure is to check for a null return on the response->toPsrResponse() and then check for a non zero in the handlerStats ssl_verify_result, but this is fragile as it depends on using the curl supplied ssl_verify_result.
Any help or pointers to more detail would be greatly appreciated!
The text was updated successfully, but these errors were encountered: