Class SSLUtil
java.lang.Object
com.github.toolarium.security.ssl.util.SSLUtil
SSL Util
-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLUtilGet the instancegetSessionId(SSLSession session) Get the SSL session idgetSSLServerSocket(SSLContext sslContext, int port, boolean propagateHotName) Get SSL server socketgetSSLServerSocket(SSLContext sslContext, int port, boolean propagateHotName, Consumer<String> consumer) Get SSL server socketvoidprocessServerSocketInfo(Consumer<String> consumer, SSLServerSocket s) Print server socket informationvoidprocessSocketInfo(Consumer<String> consumer, SSLSocket s) Print socket information
-
Method Details
-
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 contextport- the portpropagateHotName- true to propagate the hostname as SSL parameter- Returns:
- the SSL server socket
- Throws:
GeneralSecurityException- General security exceptionIOException- 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 contextport- the portpropagateHotName- true to propagate the hostname as SSL parameterconsumer- the consumer- Returns:
- the SSL server socket
- Throws:
GeneralSecurityException- General security exceptionIOException- In case of IO error
-
processSocketInfo
Print socket information- Parameters:
consumer- the consumers- the socket
-
processServerSocketInfo
Print server socket information- Parameters:
consumer- the consumers- the server socket
-
getSessionId
Get the SSL session id- Parameters:
session- the session- Returns:
- the if
-