ucar.unidata.util
Class NaiveTrustProvider
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
java.security.Provider
ucar.unidata.util.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:
- Serialized Form
|
Constructor Summary |
NaiveTrustProvider()
Hook in at the provider level to handle libraries and 3rd party
utilities that use their own factory. |
|
Method Summary |
static void |
setAlwaysTrust(boolean enableNaiveTrustProvider)
This is the only method the client code need to call. |
| Methods inherited from class java.security.Provider |
clear, elements, entrySet, get, getInfo, getName, getProperty, getService, getServices, getVersion, keys, keySet, load, put, putAll, putService, remove, removeService, toString, values |
| Methods inherited from class java.util.Properties |
getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
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
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)