I figured this out a while back so I am posting so others know the solution. The JVM looks for some system properties and a SSL provider to communicate with HTTPS. You need to provide the following in the system properties
1. Keystore
2. Keystore pass
3. Truststore
4. Truststore pass
You can google and find out the keys for the properties. Then you set the ssl provider
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
You then need to figure out what is happening behind the scenes when you open a URL connection to a https end point. If you are unable to communicate for some reason, the following stuff should be checked
1. Do you trust the server certificate ?
2. Does the server trust your certificate (if you provide one to the server. It should be in the server's trust store)
3. Is the JVM able to find your trust and keystores ?
4. Is the operation timing out ?
You can find the answers by turning JSSE debugging on. The following parameter will reveal all possible debugging options.
-Djava.security.debug=help
The program would quit with an output like the following
Choose the debugging options you require like so
java -Djavax.net.debug=SSL,handshake,data,trustmanager MyApp
More information here
http://java.sun.com/products/jsse/doc/guide/API_users_guide.html If you get errors like 'No SSL provider found' in spite of doing the stuff mentioned above
you should check the debug logs. For example if the keystore is not found the 'No SSL provider' error could be thrown.