SSLContext initialization

As you can see in the standard names documentation, all entries (SSLv3, TLSv1.0, TLSv1.1, …) say that they may support other versions. In practice, in the Oracle JDK (and OpenJDK), they all do. If you look at the source code, the TLS10Context class is what’s used for TLS, SSL, SSLv3 and TLS10, TLS11Context is used … Read more

How to override the cipherlist sent to the server by Android when using HttpsURLConnection?

This piece of code is a bit raw. please use with care. public class PreferredCipherSuiteSSLSocketFactory extends SSLSocketFactory { private static final String PREFERRED_CIPHER_SUITE = “TLS_RSA_WITH_AES_128_CBC_SHA”; private final SSLSocketFactory delegate; public PreferredCipherSuiteSSLSocketFactory(SSLSocketFactory delegate) { this.delegate = delegate; } @Override public String[] getDefaultCipherSuites() { return setupPreferredDefaultCipherSuites(this.delegate); } @Override public String[] getSupportedCipherSuites() { return setupPreferredSupportedCipherSuites(this.delegate); } @Override public … Read more

Keystore type: which one to use?

There are a few more types than what’s listed in the standard name list you’ve linked to. You can find more in the cryptographic providers documentation. The most common are certainly JKS (the default) and PKCS12 (for PKCS#12 files, often with extension .p12 or sometimes .pfx). JKS is the most common if you stay within … Read more