Class SslDomainImpl
- java.lang.Object
-
- org.apache.qpid.proton.engine.impl.ssl.SslDomainImpl
-
- All Implemented Interfaces:
ProtonSslEngineProvider,ProtonJSslDomain,SslDomain
public class SslDomainImpl extends java.lang.Object implements SslDomain, ProtonSslEngineProvider, ProtonJSslDomain
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.proton.engine.SslDomain
SslDomain.Factory, SslDomain.Mode, SslDomain.VerifyMode
-
-
Constructor Summary
Constructors Constructor Description SslDomainImpl()Application code should useSslDomain.Factory.create()instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowUnsecuredClient()voidallowUnsecuredClient(boolean allowUnsecured)Permit a server to accept connection requests from non-SSL clients.ProtonSslEnginecreateSslEngine(SslPeerDetails peerDetails)Returns an SSL engine.java.lang.StringgetCertificateFile()SslDomain.ModegetMode()SslDomain.VerifyModegetPeerAuthentication()java.lang.StringgetPrivateKeyFile()java.lang.StringgetPrivateKeyPassword()javax.net.ssl.SSLContextgetSslContext()Returns the SSLContext set bySslDomain.setSslContext(SSLContext).java.lang.StringgetTrustedCaDb()voidinit(SslDomain.Mode mode)Initialize the ssl domain object.voidsetCredentials(java.lang.String certificateFile, java.lang.String privateKeyFile, java.lang.String privateKeyPassword)Set the certificate that identifies the local node to the remote.voidsetPeerAuthentication(SslDomain.VerifyMode verifyMode)Configure the level of verification used on the peer certificate.voidsetSslContext(javax.net.ssl.SSLContext sslContext)Sets an SSLContext for use when establishing SSL transport.voidsetTrustedCaDb(java.lang.String certificateDb)Configure the set of trusted CA certificates used by this node to verify peers.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SslDomainImpl
public SslDomainImpl()
Application code should useSslDomain.Factory.create()instead.
-
-
Method Detail
-
init
public void init(SslDomain.Mode mode)
Description copied from interface:SslDomainInitialize the ssl domain object. An SSL object be either an SSL server or an SSL client. It cannot be both. Those transports that will be used to accept incoming connection requests must be configured as an SSL server. Those transports that will be used to initiate outbound connections must be configured as an SSL client.
-
getMode
public SslDomain.Mode getMode()
-
setCredentials
public void setCredentials(java.lang.String certificateFile, java.lang.String privateKeyFile, java.lang.String privateKeyPassword)Description copied from interface:SslDomainSet the certificate that identifies the local node to the remote. This certificate establishes the identity for the local node. It will be sent to the remote if the remote needs to verify the identity of this node. This may be used for both SSL servers and SSL clients (if client authentication is required by the server).- Specified by:
setCredentialsin interfaceSslDomain- Parameters:
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.
-
setTrustedCaDb
public void setTrustedCaDb(java.lang.String certificateDb)
Description copied from interface:SslDomainConfigure the set of trusted CA certificates used by this node to verify peers. If the local SSL client/server needs to verify the identity of the remote, it must validate the signature of the remote's certificate. This function sets the database of trusted CAs that will be used to verify the signature of the remote's certificate.- Specified by:
setTrustedCaDbin interfaceSslDomain- Parameters:
certificateDb- database of trusted CAs, used to authenticate the peer.
-
getTrustedCaDb
public java.lang.String getTrustedCaDb()
- Specified by:
getTrustedCaDbin interfaceSslDomain
-
setSslContext
public void setSslContext(javax.net.ssl.SSLContext sslContext)
Description copied from interface:SslDomainSets an SSLContext for use when establishing SSL transport. Setting a context this way overrides alternate configuration that might otherwise have been used to create a context, such as key and trust store paths.- Specified by:
setSslContextin interfaceSslDomain- Parameters:
sslContext- the context to use
-
getSslContext
public javax.net.ssl.SSLContext getSslContext()
Description copied from interface:SslDomainReturns the SSLContext set bySslDomain.setSslContext(SSLContext).- Specified by:
getSslContextin interfaceSslDomain- Returns:
- the SSLContext, or null if none was set.
-
setPeerAuthentication
public void setPeerAuthentication(SslDomain.VerifyMode verifyMode)
Description copied from interface:SslDomainConfigure the level of verification used on the peer certificate. This method controls how the peer's certificate is validated, if at all. By default, neither servers nor clients attempt to verify their peers (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. SeeSslDomain.setTrustedCaDb(String). NOTE: Servers must provide their own certificate when verifying a peer. SeeSslDomain.setCredentials(String, String, String)).- Specified by:
setPeerAuthenticationin interfaceSslDomain- Parameters:
verifyMode- the level of validation to apply to the peer
-
getPeerAuthentication
public SslDomain.VerifyMode getPeerAuthentication()
- Specified by:
getPeerAuthenticationin interfaceSslDomain
-
getPrivateKeyFile
public java.lang.String getPrivateKeyFile()
- Specified by:
getPrivateKeyFilein interfaceSslDomain
-
getPrivateKeyPassword
public java.lang.String getPrivateKeyPassword()
- Specified by:
getPrivateKeyPasswordin interfaceSslDomain
-
getCertificateFile
public java.lang.String getCertificateFile()
- Specified by:
getCertificateFilein interfaceSslDomain
-
allowUnsecuredClient
public void allowUnsecuredClient(boolean allowUnsecured)
Description copied from interface:SslDomainPermit a server to accept connection requests from non-SSL clients. This configures the server to "sniff" the incoming client data stream, and dynamically determine whether SSL/TLS is being used. This option is disabled by default: only clients using SSL/TLS are accepted.- Specified by:
allowUnsecuredClientin interfaceSslDomain
-
allowUnsecuredClient
public boolean allowUnsecuredClient()
- Specified by:
allowUnsecuredClientin interfaceSslDomain
-
createSslEngine
public ProtonSslEngine createSslEngine(SslPeerDetails peerDetails)
Description copied from interface:ProtonSslEngineProviderReturns an SSL engine.- Specified by:
createSslEnginein interfaceProtonSslEngineProvider- Parameters:
peerDetails- the details of the remote peer. If non-null, may be used to assist SSL session resumption.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-