Class NaiveTrustProvider

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public final class NaiveTrustProvider extends Provider
Provides all secure socket factories, with a socket that ignores problems in the chain of certificate trust. This is good for embedded applications that just want the encryption aspect of SSL communication, without worrying too much about validating the identify of the server at the other end of the connection. In other words, this may leave you vulnerable to a man-in-the-middle attack.
See Also:
  • Constructor Details

    • NaiveTrustProvider

      public NaiveTrustProvider()
      Hook in at the provider level to handle libraries and 3rd party utilities that use their own factory. Requires permission to execute AccessController.doPrivileged, so this probably won't work in applets or other high-security jvms
  • Method Details

    • setAlwaysTrust

      public static void setAlwaysTrust(boolean enableNaiveTrustProvider)
      This is the only method the client code need to call. Yup, just put NaiveTrustProvider.setAlwaysTrust() into your initialization code and you're good to go
      Parameters:
      enableNaiveTrustProvider - set to true to always trust (set to false it not yet implemented)