public class SSLUtils extends Object
Constructor and Description |
---|
SSLUtils() |
Modifier and Type | Method and Description |
---|---|
static SSLContext |
createSSLClientContext(Configuration sslConfig)
Creates the SSL Context for the client if SSL is configured.
|
static SSLContext |
createSSLServerContext(Configuration sslConfig)
Creates the SSL Context for the server if SSL is configured.
|
static boolean |
getSSLEnabled(Configuration sslConfig)
Retrieves the global ssl flag from configuration.
|
static void |
setSSLVerAndCipherSuites(ServerSocket socket,
Configuration config)
Sets SSl version and cipher suites for SSLServerSocket.
|
static void |
setSSLVerAndCipherSuites(SSLEngine engine,
Configuration config)
Sets SSL version and cipher suites for SSLEngine.
|
static void |
setSSLVerifyHostname(Configuration sslConfig,
SSLParameters sslParams)
Sets SSL options to verify peer's hostname in the certificate.
|
public static boolean getSSLEnabled(Configuration sslConfig)
sslConfig
- The application configurationpublic static void setSSLVerAndCipherSuites(ServerSocket socket, Configuration config)
socket
- Socket to be handledconfig
- The application configurationpublic static void setSSLVerAndCipherSuites(SSLEngine engine, Configuration config)
engine
- SSLEngine to be handledconfig
- The application configurationpublic static void setSSLVerifyHostname(Configuration sslConfig, SSLParameters sslParams)
sslConfig
- The application configurationsslParams
- The SSL parameters that need to be updatedpublic static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception
sslConfig
- The application configurationException
- Thrown if there is any misconfigurationpublic static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception
sslConfig
- The application configurationException
- Thrown if there is any misconfigurationCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.