Class DefaultTcpSSLContextSupport
java.lang.Object
org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport
- All Implemented Interfaces:
TcpSSLContextSupport
public class DefaultTcpSSLContextSupport extends java.lang.Object implements TcpSSLContextSupport
Default implementation of
TcpSSLContextSupport; uses a
'TLS' (by default) SSLContext, initialized with 'JKS'
keystores, managed by 'SunX509' Key and Trust managers.- Since:
- 2.1
-
Constructor Summary
Constructors Constructor Description DefaultTcpSSLContextSupport(java.lang.String keyStore, java.lang.String trustStore, java.lang.String keyStorePassword, java.lang.String trustStorePassword)Prepares for the creation of an SSLContext using the supplied key/trust stores and passwords. -
Method Summary
Modifier and Type Method Description javax.net.ssl.SSLContextgetSSLContext()Gets an SSLContext.voidsetKeyStoreType(java.lang.String keyStoreType)Set the key store type.voidsetProtocol(java.lang.String protocol)The protocol used inSSLContext.getInstance(String); default "TLS".voidsetTrustStoreType(java.lang.String trustStoreType)Set the trust store type.
-
Constructor Details
-
DefaultTcpSSLContextSupport
public DefaultTcpSSLContextSupport(java.lang.String keyStore, java.lang.String trustStore, java.lang.String keyStorePassword, java.lang.String trustStorePassword)Prepares for the creation of an SSLContext using the supplied key/trust stores and passwords.- Parameters:
keyStore- AResourcepattern pointing to the keyStore.trustStore- AResourcepattern pointing to the trustStore.keyStorePassword- The password for the keyStore.trustStorePassword- The password for the trustStore.
-
-
Method Details
-
setKeyStoreType
public void setKeyStoreType(java.lang.String keyStoreType)Set the key store type. Default JKS.- Parameters:
keyStoreType- the type.- Since:
- 5.0.8
-
setTrustStoreType
public void setTrustStoreType(java.lang.String trustStoreType)Set the trust store type. Default JKS.- Parameters:
trustStoreType- the type.- Since:
- 5.0.8
-
getSSLContext
public javax.net.ssl.SSLContext getSSLContext() throws java.security.GeneralSecurityException, java.io.IOExceptionDescription copied from interface:TcpSSLContextSupportGets an SSLContext.- Specified by:
getSSLContextin interfaceTcpSSLContextSupport- Returns:
- the SSLContext.
- Throws:
java.security.GeneralSecurityException- Any GeneralSecurityException.java.io.IOException- Any IOException.
-
setProtocol
public void setProtocol(java.lang.String protocol)The protocol used inSSLContext.getInstance(String); default "TLS".- Parameters:
protocol- The protocol.
-