Breaking News
Home / Java / Java Tutorials / Dummy SSL

Dummy SSL

SSL FactoryIntroduction
JDK 1.4.2 and above JSSE allows to plugin the implementation of the ssl security provider.
Sometimes its difficult to get the ssl/jsse working correctly due to a number of reasons.
Specially in testing applications, where the url’s are accessible via ssl , parts or all of the the ssl implementation/provider can be swapped with a custom cert if the server certificate is a self signed cert, not valid or not a trusted cert.

The idea there being is to replace sun default SSL Socket Server Factory with a dummy implementation as show below.

 

In order to override the inbuilt implementation with the dummy one, call this line at the application startup and you should be set.

Security.setProperty(“ssl.SocketFactory.provider”, com.livrona.ssl.utils.DummySSLSocketFactory”);

Trouble Shooting
In order to trouble shoot and see if this thing really works we can turn the ssl debugging on by adding following option to the java command line.
-Djavax.net.debug=ssl,handshake,data,trustmanager

So in this way you can still do SSL without the hassle.This has worked for me more than 2 times, when the server certificate with no good.
If there are other ways to do, please share here.[pb_builder]

Check Also

How to enable Java in Internet Explorer 8.0?

If the Java Plugin is not installed or enabled the applet would not run in …

Advertisment ad adsense adlogger