public class SSLTestConfig
extends org.apache.solr.client.solrj.embedded.SSLConfig
SSLConfig that supports reading key/trust store information directly from resource
files provided with the Solr test-framework classes| Modifier and Type | Field and Description |
|---|---|
static File |
TEST_KEYSTORE
Deprecated.
No longer used except by
setSSLSystemProperties() |
| Constructor and Description |
|---|
SSLTestConfig()
Creates an SSLTestConfig that does not use SSL or client authentication
|
SSLTestConfig(boolean useSSL,
boolean clientAuth)
Create an SSLTestConfig based on a few caller specified options.
|
SSLTestConfig(boolean useSSL,
boolean clientAuth,
String keyStore,
String keyStorePassword,
String trustStore,
String trustStorePassword)
Deprecated.
- use
SSLConfig directly |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.conn.ssl.SSLConnectionSocketFactory |
buildClientSSLConnectionSocketFactory()
Constructs a new SSLConnectionSocketFactory for HTTP clients to use when communicating
with servers which have been configured based on the settings of this object.
|
SSLContext |
buildClientSSLContext()
Builds a new SSLContext for HTTP clients to use when communicating with servers which have
been configured based on the settings of this object.
|
protected static KeyStore |
buildKeyStore(org.eclipse.jetty.util.resource.Resource resource,
String password)
Constructs a KeyStore using the specified filename and password
|
SSLContext |
buildServerSSLContext()
Builds a new SSLContext for jetty servers which have been configured based on the settings of
this object.
|
static void |
clearSSLSystemProperties()
Deprecated.
this method has very little practical use, in most cases you'll want to use
SSLContext.setDefault(javax.net.ssl.SSLContext) with buildClientSSLContext() instead. |
org.eclipse.jetty.util.ssl.SslContextFactory |
createContextFactory()
Returns an SslContextFactory using
buildServerSSLContext() if SSL should be used, else returns null. |
org.apache.solr.client.solrj.impl.HttpClientConfigurer |
getHttpClientConfigurer()
Creates a
HttpClientConfigurer for HTTP clients to use when communicating with servers
which have been configured based on the settings of this object. |
String |
getKeyStore()
NOTE: This method is meaningless unless you explicitly provide paths when constructing this instance
|
String |
getTrustStore()
NOTE: This method is meaningless unless you explicitly provide paths when constructing this instance
|
static void |
setSSLSystemProperties()
Deprecated.
this method has very little practical use, in most cases you'll want to use
SSLContext.setDefault(javax.net.ssl.SSLContext) with buildClientSSLContext() instead. |
static boolean |
toBooleanDefaultIfNull(Boolean bool,
boolean valueIfNull) |
static Boolean |
toBooleanObject(String str) |
public static File TEST_KEYSTORE
setSSLSystemProperties()public SSLTestConfig()
public SSLTestConfig(boolean useSSL,
boolean clientAuth)
useSSL - - wether SSL should be required.clientAuth - - whether client authentication should be required.@Deprecated public SSLTestConfig(boolean useSSL, boolean clientAuth, String keyStore, String keyStorePassword, String trustStore, String trustStorePassword)
SSLConfig directlypublic String getKeyStore()
getKeyStore in class org.apache.solr.client.solrj.embedded.SSLConfigSSLTestConfig(boolean,boolean,String,String,String,String)public String getTrustStore()
getTrustStore in class org.apache.solr.client.solrj.embedded.SSLConfigSSLTestConfig(boolean,boolean,String,String,String,String)public org.apache.solr.client.solrj.impl.HttpClientConfigurer getHttpClientConfigurer()
HttpClientConfigurer for HTTP clients to use when communicating with servers
which have been configured based on the settings of this object. When SSLConfig.isSSLMode() is true, this
HttpClientConfigurer will only support HTTPS (no HTTP scheme) using the
appropriate certs. When SSLConfig.isSSLMode() is false, only HTTP (no HTTPS scheme) will be
supported.public SSLContext buildClientSSLContext() throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException
SecureRandom instance to prevent tests from blocking
due to lack of entropy, also explicitly allows the use of self-signed
certificates (since that's what is almost always used during testing).public SSLContext buildServerSSLContext() throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException
SecureRandom instance to prevent tests from blocking
due to lack of entropy, also explicitly allows the use of self-signed
certificates (since that's what is almost always used during testing).
almost always used during testing).public org.eclipse.jetty.util.ssl.SslContextFactory createContextFactory()
buildServerSSLContext() if SSL should be used, else returns null.createContextFactory in class org.apache.solr.client.solrj.embedded.SSLConfigprotected static KeyStore buildKeyStore(org.eclipse.jetty.util.resource.Resource resource, String password)
public org.apache.http.conn.ssl.SSLConnectionSocketFactory buildClientSSLConnectionSocketFactory()
SSLConfig.isSSLMode() is true.public static boolean toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull)
@Deprecated public static void setSSLSystemProperties()
SSLContext.setDefault(javax.net.ssl.SSLContext) with buildClientSSLContext() instead.@Deprecated public static void clearSSLSystemProperties()
SSLContext.setDefault(javax.net.ssl.SSLContext) with buildClientSSLContext() instead.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.