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.SSLContext getSSLContext()
    Gets an SSLContext.
    void setKeyStoreType​(java.lang.String keyStoreType)
    Set the key store type.
    void setProtocol​(java.lang.String protocol)
    The protocol used in SSLContext.getInstance(String); default "TLS".
    void setTrustStoreType​(java.lang.String trustStoreType)
    Set the trust store type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 - A Resource pattern pointing to the keyStore.
      trustStore - A Resource pattern 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.IOException
      Description copied from interface: TcpSSLContextSupport
      Gets an SSLContext.
      Specified by:
      getSSLContext in interface TcpSSLContextSupport
      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 in SSLContext.getInstance(String); default "TLS".
      Parameters:
      protocol - The protocol.