briandilley / jsonrpc4j

JSON-RPC for Java
MIT License
1.05k stars 438 forks source link

enable keep-alive for HTTPS (static sslSocketFactory) #287

Closed miditeam closed 1 year ago

miditeam commented 2 years ago

During a migration from HTTP to HTTPS, we noticed that our JsonRpcHttpClient-based application was no longer using keep-alive connections.

After some research we found Bill Healey's answer on a Stack Overflow post, which explains why: for a connection/socket to be reused, quasi everything about it must constant, including sub-objects attached to the connection.

For SSL in particular the SSLSocketFactory object must be the same across calls to the HttpsUrlConnection. This pull request implements this improvement, which yielded a huge performance boost when using SSL / HTTPS. Instead of using the existing setSslContext() context, one must use the new setSslSocketFactory() method.

The PR does not include a documentation update (could not find an adequate place where to insert) but of course we think that it would be worth it to add a warning about this.

miditeam commented 2 years ago

Hello there! Did you have time to take a look at this, any issue ?

miditeam commented 2 years ago

Hi @briandilley, any chance to get this simple extension merged? It is good for the performance of the library and it would allow us to rely on the official distribution again. Thanks!

miditeam commented 1 year ago

Hi @briandilley. Are you still maintaining this project? Or should we contact someone else?

miditeam commented 1 year ago

Looks like this repo is no longer supported. We raised issue #304 to try and clarify.