@InterfaceAudience.Private @InterfaceStability.Evolving public class SSLFactory extends Object implements org.apache.hadoop.security.authentication.client.ConnectionConfigurator
ReloadingX509TrustManager
instance,
which reloads public keys if the truststore file changes.
This factory is used to configure HTTPS in Hadoop HTTP based endpoints, both
client and server.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SSL_ENABLED_PROTOCOLS |
static String |
SSL_ENABLED_PROTOCOLS |
Constructor and Description |
---|
SSLFactory(org.apache.hadoop.security.ssl.SSLFactory.Mode mode,
org.apache.hadoop.conf.Configuration conf)
Creates an SSLFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(com.ning.http.client.AsyncHttpClientConfig.Builder asyncNingBuilder)
Set ssl context for
AsyncHttpClientConfig.Builder |
HttpURLConnection |
configure(HttpURLConnection conn)
If the given
HttpURLConnection is an HttpsURLConnection
configures the connection with the SSLSocketFactory and
HostnameVerifier of this SSLFactory, otherwise does nothing. |
SSLSocketFactory |
createSSLSocketFactory()
Returns a configured SSLSocketFactory.
|
void |
destroy()
Releases any resources being used.
|
HostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier it should be used in HttpsURLConnections.
|
static HostnameVerifier |
getHostnameVerifier(String verifier) |
org.apache.hadoop.security.ssl.KeyStoresFactory |
getKeystoresFactory()
Returns the SSLFactory KeyStoresFactory instance.
|
void |
init()
Initializes the factory.
|
public static final String SSL_ENABLED_PROTOCOLS
public static final String DEFAULT_SSL_ENABLED_PROTOCOLS
public SSLFactory(org.apache.hadoop.security.ssl.SSLFactory.Mode mode, org.apache.hadoop.conf.Configuration conf)
mode
- SSLFactory mode, client or server.conf
- Hadoop configuration from where the SSLFactory configuration
will be read.public void init() throws GeneralSecurityException, IOException
GeneralSecurityException
- thrown if an SSL initialization error
happened.IOException
- thrown if an IO error happened while reading the SSL
configuration.public static HostnameVerifier getHostnameVerifier(String verifier) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public void destroy()
public org.apache.hadoop.security.ssl.KeyStoresFactory getKeystoresFactory()
public SSLSocketFactory createSSLSocketFactory() throws GeneralSecurityException, IOException
GeneralSecurityException
- thrown if the SSLSocketFactory could not
be initialized.IOException
- thrown if and IO error occurred while loading
the server keystore.public HostnameVerifier getHostnameVerifier()
public HttpURLConnection configure(HttpURLConnection conn) throws IOException
HttpURLConnection
is an HttpsURLConnection
configures the connection with the SSLSocketFactory
and
HostnameVerifier
of this SSLFactory, otherwise does nothing.configure
in interface org.apache.hadoop.security.authentication.client.ConnectionConfigurator
conn
- the HttpURLConnection
instance to configure.HttpURLConnection
instance.IOException
- if an IO error occurred.public void configure(com.ning.http.client.AsyncHttpClientConfig.Builder asyncNingBuilder) throws IOException
AsyncHttpClientConfig.Builder
asyncNingBuilder
- AsyncHttpClientConfig.Builder
instance to
configure.IOException
- if an IO error occurred.Copyright © 2016 Apache Software Foundation. All rights reserved.