Disabling Java Certificate Validation

Let’s see in this post how to disable the Java certificate validation for secure connections.

Before, I really recommend that you don’t do this when you intend to connect to somewhere outside of your DMZ, Disabling the trust manager defeats some parts of SSL and makes you vulnerable to man in the middle attacks, but wait, in this case, maybe even inside the DMZ… who knows 😀

Anyway, recently I had to authenticate to an internal MongoDb using SSL and I got some issues, how it was for a small internal application, the choice was just disabling the certificate validation.

This small snippet if used in a wrong way has the potential to put you in danger, be careful 🙂

Leave a Reply