I have an app which connects to a server via HTTPS. The server in question has a weak certificate which utilises RC4 Cipher (default support for which was recently removed from the JDK https://www.java.com/en/download/faq/release_changes.xml) So following upgrade of the JDK, I am seeing javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
The release notes specify that you should use SSLSocket/SSLEngine.setEnabledCipherSuites() to specifically enable certain ciphers.
However, using HttpsUrlConnection, or Apache's CloseableHttpClient, I can only find how to specify the SslSocketFactory. Which doesn't seem to provide function .setEnabledCipherSuites.
Found this post: Why does SSLSocketFactory lack setEnabledCipherSuites?
My question is: Is there a way to get hold of the SSLEngine/Socket on an outbound client HTTP request so I can set the cipher suites before the handshake?
Thanks in advance.