public class SslDomainImpl extends Object implements SslDomain, ProtonSslEngineProvider, ProtonJSslDomain
SslDomain.Factory, SslDomain.Mode, SslDomain.VerifyMode
Constructor and Description |
---|
SslDomainImpl()
Deprecated.
This constructor's visibility will be reduced to the default scope in a future release.
Client code outside this module should use
SslDomain.Factory#create() instead. |
Modifier and Type | Method and Description |
---|---|
boolean |
allowUnsecuredClient() |
void |
allowUnsecuredClient(boolean allowUnsecured)
Permit a server to accept connection requests from non-SSL clients.
|
ProtonSslEngine |
createSslEngine(SslPeerDetails peerDetails)
Returns an SSL engine.
|
String |
getCertificateFile() |
SslDomain.Mode |
getMode() |
SslDomain.VerifyMode |
getPeerAuthentication() |
String |
getPrivateKeyFile() |
String |
getPrivateKeyPassword() |
String |
getTrustedCaDb() |
void |
init(SslDomain.Mode mode)
Initialize the ssl domain object.
|
void |
setCredentials(String certificateFile,
String privateKeyFile,
String privateKeyPassword)
Set the certificate that identifies the local node to the remote.
|
void |
setPeerAuthentication(SslDomain.VerifyMode verifyMode)
Configure the level of verification used on the peer certificate.
|
void |
setTrustedCaDb(String certificateDb)
Configure the set of trusted CA certificates used by this node to verify peers.
|
String |
toString() |
@Deprecated public SslDomainImpl()
SslDomain.Factory#create()
instead.public void init(SslDomain.Mode mode)
SslDomain
public SslDomain.Mode getMode()
public void setCredentials(String certificateFile, String privateKeyFile, String privateKeyPassword)
SslDomain
setCredentials
in interface SslDomain
certificateFile
- path to file/database containing the identifying
certificate.privateKeyFile
- path to file/database containing the private key used to
sign the certificateprivateKeyPassword
- the password used to sign the key, else null if key is not
protected.public void setTrustedCaDb(String certificateDb)
SslDomain
setTrustedCaDb
in interface SslDomain
certificateDb
- database of trusted CAs, used to authenticate the peer.public String getTrustedCaDb()
getTrustedCaDb
in interface SslDomain
public void setPeerAuthentication(SslDomain.VerifyMode verifyMode)
SslDomain
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
SslDomain.setTrustedCaDb(String)
.
NOTE: Servers must provide their own certificate when verifying a peer. See
SslDomain.setCredentials(String, String, String)
).setPeerAuthentication
in interface SslDomain
verifyMode
- the level of validation to apply to the peerpublic SslDomain.VerifyMode getPeerAuthentication()
getPeerAuthentication
in interface SslDomain
public String getPrivateKeyFile()
getPrivateKeyFile
in interface SslDomain
public String getPrivateKeyPassword()
getPrivateKeyPassword
in interface SslDomain
public String getCertificateFile()
getCertificateFile
in interface SslDomain
public void allowUnsecuredClient(boolean allowUnsecured)
SslDomain
allowUnsecuredClient
in interface SslDomain
public boolean allowUnsecuredClient()
allowUnsecuredClient
in interface SslDomain
public ProtonSslEngine createSslEngine(SslPeerDetails peerDetails)
ProtonSslEngineProvider
createSslEngine
in interface ProtonSslEngineProvider
peerDetails
- the details of the remote peer. If non-null, may be used to assist SSL session resumption.Copyright © 2016 The Apache Software Foundation. All rights reserved.