Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Wednesday, 14 October 2015

Enable TLS in Standalone Java to connect to WSO2 IS

Some days ago, I wrote a blog on how to disable SSL and enable TLS in WebLogic application server. The link is here if you are interested to read further http://ayyappan-gandhirajan.blogspot.in/2015/09/enable-tls-security-in-weblogic-n-WSO2-IS.html

My colleague has approached me today to know how to do the same thing in a Core Java environment - I mean he is running a standalone program which uses HttpURLConnection to connect to HTTPS URL (which is hosted in WSO2 Identity Server, available at http://wso2.com/products/identity-server/)

After spending some time, I found a way to do this which has been described below:

1. Add JVM argument -Dhttps.protocols=TLSv1 on the client side

2. Or add this line into your the jave program - java.lang.System.setProperty("https.protocols", "TLSv1");

He just added JVM argument, and now he is able to connect the HTTPS URL without any issue.

Hope you like it.

No comments:

Post a Comment