Class SSLContextCollection
java.lang.Object
com.predic8.membrane.core.transport.ssl.SSLContextCollection
- All Implemented Interfaces:
SSLProvider
Manages multiple
SSLContexts using the same port. This is only possible when using SSL with
"Server Name Indication", see ... .
This requires Java 8.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncreateServerSocket(int port, int backlog, InetAddress bindAddress) createSocket(String host, int port, int connectTimeout, String sniServerName, String[] applicationProtocols) createSocket(String host, int port, InetAddress addr, int localPort, int connectTimeout, String sniServerName, String[] applicationProtocols) createSocket(Socket s, String host, int port, int connectTimeout, String sniServerName, String[] applicationProtocols) String[]getApplicationProtocols(Socket socket) booleanvoidstop()Advises the SSL Provider to stop providing its services.wrapAcceptedSocket(Socket socket)
-
Method Details
-
createServerSocket
public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException - Specified by:
createServerSocketin interfaceSSLProvider- Throws:
IOException
-
wrapAcceptedSocket
- Specified by:
wrapAcceptedSocketin interfaceSSLProvider- Throws:
IOException
-
createSocket
- Specified by:
createSocketin interfaceSSLProvider- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress addr, int localPort, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException - Specified by:
createSocketin interfaceSSLProvider- Throws:
IOException
-
showSSLExceptions
public boolean showSSLExceptions()- Specified by:
showSSLExceptionsin interfaceSSLProvider
-
createSocket
public Socket createSocket(String host, int port, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException - Specified by:
createSocketin interfaceSSLProvider- Throws:
IOException
-
createSocket
public Socket createSocket(Socket s, String host, int port, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException - Specified by:
createSocketin interfaceSSLProviderhost- relevant to verify the server cert onlyport- relevant to verify the server cert only- Throws:
IOException
-
getApplicationProtocols
- Specified by:
getApplicationProtocolsin interfaceSSLProvider- Returns:
- the application protocols selected by the TLS server, or null elsewise (not a TLS connection, ALPN not supported, ...)
-
stop
public void stop()Description copied from interface:SSLProviderAdvises the SSL Provider to stop providing its services. (For most providers this will be a no-op.)No guarantee that this is only called once.
- Specified by:
stopin interfaceSSLProvider
-