exceptionfactory / socketbroker

Java Socket library supporting SOCKS and HTTP proxy servers with authentication
Apache License 2.0
7 stars 0 forks source link

Support SSLSocketFactory #2

Open corneliakramerkarlsson opened 1 month ago

corneliakramerkarlsson commented 1 month ago

Hi,

Thanks for a great library. However, I would need a SSLSocketFactory implementation of BrokeredSocketFactory. Would it make sense to support this as well in the library?

exceptionfactory commented 1 month ago

Thanks for the feedback @corneliakramerkarlsson!

The BrokeredSocketFactory takes a SocketFactory instance in the constructor, which would support connecting to an HTTP proxy with TLS using a provided SSLSocketFactory.

If you can provide some additional details about your intended use case, that would be helpful.

corneliakramerkarlsson commented 1 month ago

The problem is that BrokeredSocketFactory doesn’t implement SSLSocketFactory , so I can’t use it in methods explicitly requiring SSLSocketFactory.

johanhaleby commented 1 month ago

I have the same issue. It would be nice to use it in e.g. OkHttp by providing a "sslSocketFactory".

exceptionfactory commented 1 month ago

Thanks for the feedback @corneliakramerkarlsson and @johanhaleby. Although OkHttp provides its own solution for SOCKS 5 and HTTP proxy access, I can also see some general usefulness in an SSLSocketFactory implementation that performs the current proxy negotiation capabilities and then delegates the remaining TLS communication to a supporting SSLSocketFactory implementation.