java.lang.Object
com.github.toolarium.security.ssl.util.SSLUtil

public final class SSLUtil extends Object
SSL Util
  • Method Details

    • getInstance

      public static SSLUtil getInstance()
      Get the instance
      Returns:
      the instance
    • getSSLServerSocket

      public SSLServerSocket getSSLServerSocket(SSLContext sslContext, int port, boolean propagateHotName) throws GeneralSecurityException, IOException
      Get SSL server socket
      Parameters:
      sslContext - the SSL context
      port - the port
      propagateHotName - true to propagate the hostname as SSL parameter
      Returns:
      the SSL server socket
      Throws:
      GeneralSecurityException - General security exception
      IOException - In case of IO error
    • getSSLServerSocket

      public SSLServerSocket getSSLServerSocket(SSLContext sslContext, int port, boolean propagateHotName, Consumer<String> consumer) throws GeneralSecurityException, IOException
      Get SSL server socket
      Parameters:
      sslContext - the SSL context
      port - the port
      propagateHotName - true to propagate the hostname as SSL parameter
      consumer - the consumer
      Returns:
      the SSL server socket
      Throws:
      GeneralSecurityException - General security exception
      IOException - In case of IO error
    • processSocketInfo

      public void processSocketInfo(Consumer<String> consumer, SSLSocket s)
      Print socket information
      Parameters:
      consumer - the consumer
      s - the socket
    • processServerSocketInfo

      public void processServerSocketInfo(Consumer<String> consumer, SSLServerSocket s)
      Print server socket information
      Parameters:
      consumer - the consumer
      s - the server socket
    • getSessionId

      public String getSessionId(SSLSession session)
      Get the SSL session id
      Parameters:
      session - the session
      Returns:
      the if