Closed nns52k closed 5 months ago
It turns out that method HttpClient.badCertificateCallback
is not used. To deal with a bad certificate, pass a callback as the named argument onBadCertificate
to static method SocksTCPClient.assignToHttpClientWithSecureOptions
. Sorry for the noise.
If the schema is HTTPS, and the proxy destination provides a self-signed certificate, the invocation
SocksSocket.secure
in line #86 in file~/.pub-cache/hosted/pub.dev/socks5_proxy-1.0.5+dev.1/lib/src/client/socks_client.dart
will throw anHandshakeException
of which the message is:The
HttpClient
variable that was passed toSocksTCPClient.assignToHttpClient
has no chance to deal with the certificate. Usually we would expect thebadCertificateCallback
of theHttpClient
to be triggered to decide whether or not to accept the certificate, but the current behavior is to throw anHandshakeException
unhandled. There is no option to accept the self-signed certificate, if we want to.