public class CertificateAuthSettings extends Object
given().auth().certificate("keystore.jks", "my_password", certAuthSettings().allowAllHostNames());
Constructor and Description |
---|
CertificateAuthSettings()
Create a new instance of the Certificate Authentication Options with the default settings of:
keystoreType =
KeyStore.getDefaultType()
trustStoreType = KeyStore.getDefaultType()
port = 443
trustStore = null
keyStore = null
x509HostnameVerifier = SSLSocketFactory.STRICT_HOSTNAME_VERIFIER
SSLSocketFactory = null
|
Modifier and Type | Method and Description |
---|---|
CertificateAuthSettings |
allowAllHostnames()
Configure the CertificateAuthSettings to allow all host names.
|
CertificateAuthSettings |
and()
Syntactic sugar.
|
static CertificateAuthSettings |
certAuthSettings()
Create a new instance of
CertificateAuthSettings with default values. |
KeyStore |
getKeyStore() |
String |
getKeyStoreType() |
int |
getPort() |
org.apache.http.conn.ssl.SSLSocketFactory |
getSSLSocketFactory() |
KeyStore |
getTrustStore() |
String |
getTrustStoreType() |
org.apache.http.conn.ssl.X509HostnameVerifier |
getX509HostnameVerifier() |
CertificateAuthSettings |
keyStore(KeyStore keyStore) |
CertificateAuthSettings |
keyStoreType(String keystoreType) |
CertificateAuthSettings |
port(int port) |
CertificateAuthSettings |
sslSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory sslSocketFactory) |
CertificateAuthSettings |
strictHostnames()
Configure the CertificateAuthSettings to use strict host name verification (this is the default behavior).
|
CertificateAuthSettings |
trustStore(KeyStore trustStore) |
CertificateAuthSettings |
trustStoreType(String trustStoreType) |
CertificateAuthSettings |
using()
Syntactic sugar.
|
CertificateAuthSettings |
with()
Syntactic sugar.
|
CertificateAuthSettings |
x509HostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier)
Configure the CertificateAuthSettings to use the provided
X509HostnameVerifier instance. |
public CertificateAuthSettings()
KeyStore.getDefaultType()
KeyStore.getDefaultType()
SSLSocketFactory.STRICT_HOSTNAME_VERIFIER
certAuthSettings()
public String getKeyStoreType()
public String getTrustStoreType()
public int getPort()
public KeyStore getTrustStore()
public KeyStore getKeyStore()
public org.apache.http.conn.ssl.SSLSocketFactory getSSLSocketFactory()
public CertificateAuthSettings strictHostnames()
SSLSocketFactory.STRICT_HOSTNAME_VERIFIER
public CertificateAuthSettings allowAllHostnames()
SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
public CertificateAuthSettings x509HostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier)
X509HostnameVerifier
instance.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
,
allowAllHostnames()
public org.apache.http.conn.ssl.X509HostnameVerifier getX509HostnameVerifier()
public CertificateAuthSettings keyStoreType(String keystoreType)
keystoreType
- The keystore type, by default KeyStore.getDefaultType()
.CertificateAuthSettings
with the updated setting.public CertificateAuthSettings trustStoreType(String trustStoreType)
trustStoreType
- The trust store type, by default KeyStore.getDefaultType()
.CertificateAuthSettings
with the updated setting.public CertificateAuthSettings port(int port)
port
- The port, by default 443.CertificateAuthSettings
with the updated setting.public CertificateAuthSettings trustStore(KeyStore trustStore)
trustStore
- The trust store to use, by default no (null
) trust store is used.CertificateAuthSettings
with the updated setting.public CertificateAuthSettings keyStore(KeyStore keyStore)
keyStore
- The key store to use, by default no (null
) key store is used.CertificateAuthSettings
with the updated setting.public CertificateAuthSettings sslSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory sslSocketFactory)
sslSocketFactory
- The SSLSocketFactory to useCertificateAuthSettings
with the updated setting.public CertificateAuthSettings and()
public CertificateAuthSettings with()
public CertificateAuthSettings using()
public static CertificateAuthSettings certAuthSettings()
CertificateAuthSettings
with default values. Same as called CertificateAuthSettings()
but a bit more "fluent".CertificateAuthSettings
with default values.Copyright © 2010–2019. All rights reserved.