Enabled TLS 1.2 and TLS 1.1 on Java 7

Happy Friday!

Just drop a line about enabling TLS 1.2 and TLS 1.1 in JRE 7. Java 7 supports TLS1.1 and TLS1.2, but they are not enabled by default. See https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https  There are many posts about dynamically enable them but I was quite frustrated when testing them out. It turns out you would only need a system param


or code as

System.setProperty(“https.protocols”, “TLSv1,TLSv1.1,TLSv1.2”);

Hope it can save you some time!