Package ucar.unidata.util
Class NaiveTrustProvider
java.lang.Object
java.util.Dictionary<Object,Object>
java.util.Hashtable<Object,Object>
java.util.Properties
java.security.Provider
ucar.unidata.util.NaiveTrustProvider
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The factory for the NaiveTrustProviderNested classes/interfaces inherited from class java.security.Provider
Provider.Service
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
ConstructorsConstructorDescriptionHook in at the provider level to handle libraries and 3rd party utilities that use their own factory. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
setAlwaysTrust
(boolean enableNaiveTrustProvider) This is the only method the client code need to call.Methods inherited from class java.security.Provider
clear, compute, computeIfAbsent, computeIfPresent, configure, elements, entrySet, forEach, get, getInfo, getName, getOrDefault, getProperty, getService, getServices, getVersion, getVersionStr, isConfigured, keys, keySet, load, merge, put, putAll, putIfAbsent, putService, remove, remove, removeService, replace, replace, replaceAll, toString, values
Methods inherited from class java.util.Properties
clone, contains, containsKey, containsValue, equals, getProperty, hashCode, isEmpty, list, list, load, loadFromXML, propertyNames, rehash, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames
-
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)
-