Package org.apache.hc.core5.ssl
Class SSLContexts
java.lang.Object
org.apache.hc.core5.ssl.SSLContexts
SSLContext
factory methods.
Please note: the default Oracle JSSE implementation of
SSLContext#init(KeyManager[], TrustManager[], SecureRandom)
accepts multiple key and trust managers, however only only first matching type is ever used.
See for example:
SSLContext.html#init
- Since:
- 4.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContext
Creates default factory based on the standard JSSE trust material (cacerts
file in the security properties directory).static SSLContext
Creates default SSL context based on system properties.static SSLContextBuilder
custom()
Creates custom SSL context.
-
Constructor Details
-
SSLContexts
private SSLContexts()
-
-
Method Details
-
createDefault
Creates default factory based on the standard JSSE trust material (cacerts
file in the security properties directory). System properties are not taken into consideration.- Returns:
- the default SSL socket factory
- Throws:
SSLInitializationException
- if NoSuchAlgorithmException or KeyManagementException are thrown when invokingSSLContext.getInstance(String)
-
createSystemDefault
Creates default SSL context based on system properties. This method obtains default SSL context by callingSSLContext.getInstance("Default")
. Please note thatDefault
algorithm is supported as of Java 6. This method will fall back ontocreateDefault()
whenDefault
algorithm is not available.- Returns:
- default system SSL context
- Throws:
SSLInitializationException
- ifcreateDefault()
throws it
-
custom
Creates custom SSL context.- Returns:
- default system SSL context
-