public interface SslDomain
Modifier and Type | Interface and Description |
---|---|
static class |
SslDomain.Factory |
static class |
SslDomain.Mode
Determines whether the endpoint acts as a client or server.
|
static class |
SslDomain.VerifyMode
Determines the level of peer validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowUnsecuredClient() |
void |
allowUnsecuredClient(boolean allowUnsecured)
Permit a server to accept connection requests from non-SSL clients.
|
java.lang.String |
getCertificateFile() |
SslDomain.Mode |
getMode() |
SslDomain.VerifyMode |
getPeerAuthentication() |
java.lang.String |
getPrivateKeyFile() |
java.lang.String |
getPrivateKeyPassword() |
javax.net.ssl.SSLContext |
getSslContext()
Returns the SSLContext set by
setSslContext(SSLContext) . |
java.lang.String |
getTrustedCaDb() |
void |
init(SslDomain.Mode mode)
Initialize the ssl domain object.
|
void |
setCredentials(java.lang.String certificateFile,
java.lang.String privateKeyFile,
java.lang.String password)
Set the certificate that identifies the local node to the remote.
|
void |
setPeerAuthentication(SslDomain.VerifyMode mode)
Configure the level of verification used on the peer certificate.
|
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets an SSLContext for use when establishing SSL transport.
|
void |
setTrustedCaDb(java.lang.String certificateDb)
Configure the set of trusted CA certificates used by this node to verify peers.
|
void init(SslDomain.Mode mode)
SslDomain.Mode getMode()
void setCredentials(java.lang.String certificateFile, java.lang.String privateKeyFile, java.lang.String password)
certificateFile
- path to file/database containing the identifying
certificate.privateKeyFile
- path to file/database containing the private key used to
sign the certificatepassword
- the password used to sign the key, else null if key is not
protected.java.lang.String getPrivateKeyFile()
java.lang.String getPrivateKeyPassword()
java.lang.String getCertificateFile()
void setTrustedCaDb(java.lang.String certificateDb)
certificateDb
- database of trusted CAs, used to authenticate the peer.java.lang.String getTrustedCaDb()
void setPeerAuthentication(SslDomain.VerifyMode mode)
SslDomain.VerifyMode.ANONYMOUS_PEER
).
Once certificates and trusted CAs are configured, peer verification can be enabled.
In order to verify a peer, a trusted CA must be configured. See
setTrustedCaDb(String)
.
NOTE: Servers must provide their own certificate when verifying a peer. See
setCredentials(String, String, String)
).mode
- the level of validation to apply to the peerSslDomain.VerifyMode getPeerAuthentication()
void allowUnsecuredClient(boolean allowUnsecured)
boolean allowUnsecuredClient()
void setSslContext(javax.net.ssl.SSLContext sslContext)
sslContext
- the context to usejavax.net.ssl.SSLContext getSslContext()
setSslContext(SSLContext)
.