--Java 6 (old ...)
TLS1.2 Encrypted communication protocol with no confirmed vulnerabilities
It is also used for HTTPS communication. Vulnerabilities have been found in SSL3.0, TLS1.0, and TLS1.1. Since the protocol used for HTTPS communication can be limited, if the other party limits it to TLS1.2, this must also be supported.
Java 6 The free version has not been upgraded, so it is not supported ...
When I googled, I found an article trying to do something similar on stackoverflow. I organized it myself and posted it on github. (Required bouncy castle)
https://github.com/a--i--r/TLSSocketFactory
TLSSocketFactory
Simple format
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
Self-signed certificate support
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory(true));
Self-signed certificate + socket timeout setting
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory(true, 60000));
Communication using HttpsURLConnection will be compatible with TLS1.2. I would be grateful if you could use it to support old programs.
Recommended Posts