Java 7 - SSL how to trust all certificates

Viewed 7000

I am writing a Java proxy which communicates to other servers using SSL. It all works well using ServerSocketFactory along with keystore and trustore which is populated with the server cert.

I wonder, is there a way in Java 7 to disable the certification and trust all servers? (and yes I know this is risky - bu the proxy is for internal use only)

I have seen some examples of implementing TrustManager using X509TrustManager implementation, although apparently Java 7 does not support these contracts and X509TrustManager itself has been deprecated.

Appreciate your advise and any code sample on Java 7 that works.

2 Answers
Related