amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.
https://amphp.org/http-client
MIT License
704 stars 66 forks source link

Invalid certificate throws a misleading error #360

Open joelwurtz opened 7 months ago

joelwurtz commented 7 months ago

I was struggling why some of my http calls where not working, where in fact it was due to a bad ssl certificate, however amphp give an error like this :

Amp\Http\Client\SocketException: Connection to '****:443' @ '172.18.0.13:443' closed during TLS handshake at /app/tests/integration/vendor/amphp/http-client/src/Connection/DefaultConnectionFactory.php:137'

Also in this case the connection seems to be interrupted abruptly.

I think there could be a better error that show that it's an invalid certificate