During TLS negotiation, clients send a list of supported ciphers to the server, the server picks one, and encryption starts. I want to change this cipherlist sent to the server by Android, when I'm using HttpsURLConnection for communication.
I know that I can use setSSLSocketFactory on the HttpsURLConnection object to set it up to use a SSLSocketFactory. This is useful when I want to change the trustmanager etc used by the SSLSocket returned by the SSLSocketFactory.
I know that in general this ciphersuite list can be edited using an SSLParameters object and passing it to SSlsocket or SSLEngine objects using the methods they provide.
BUT the SSLSocketFactory does not seem to expose such methods!
I cannot find a way to change the SSLParameters of the returned SSLSocket objects created by the SSLSocketFactory I pass to HttpsURLConnection.
What to do?
I guess this is also relevant to Java in general, not only Android. Maybe there's an OO way to do it (e.g. extend SSLSocketFactory and provide that to HttpsURLConnection?)