global-agent icon indicating copy to clipboard operation
global-agent copied to clipboard

HTTPS proxy can cause confusing 'Error: write EPROTO 8669745856...' error

Open BogdanCln opened this issue 2 years ago • 1 comments

Hello and thanks for taking your time to read this!

The issue I'm facing is that sometimes the proxy responds with an error status code to the CONNECT request which is not handled. Currently, global-agent considers that once a response for the CONNECT request is received, it is fine to start the TLS handshake. That will result in a confusing error if the proxy refuses the connection: Error: write EPROTO 8669745856:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:. Two common cases when this happens are wrong authentication and proxy access filter declining the request. In both cases, the proxy will respond with an error status code (>=400) to the CONNECT request.

I created a PR for this: https://github.com/gajus/global-agent/pull/61

More details and replication guide are included there.

BogdanCln avatar Jan 18 '23 13:01 BogdanCln

I have the same problem!

NPhMKgbDNy1M avatar Apr 20 '23 19:04 NPhMKgbDNy1M