Package org.java_websocket.server
Class CustomSSLWebSocketServerFactory
- java.lang.Object
-
- org.java_websocket.server.DefaultSSLWebSocketServerFactory
-
- org.java_websocket.server.CustomSSLWebSocketServerFactory
-
- All Implemented Interfaces:
WebSocketFactory,WebSocketServerFactory
public class CustomSSLWebSocketServerFactory extends DefaultSSLWebSocketServerFactory
WebSocketFactory that can be configured to only support specific protocols and cipher suites.
-
-
Field Summary
-
Fields inherited from class org.java_websocket.server.DefaultSSLWebSocketServerFactory
exec, sslcontext
-
-
Constructor Summary
Constructors Constructor Description CustomSSLWebSocketServerFactory(SSLContext sslContext, String[] enabledProtocols, String[] enabledCiphersuites)New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.CustomSSLWebSocketServerFactory(SSLContext sslContext, ExecutorService executerService, String[] enabledProtocols, String[] enabledCiphersuites)New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteChannelwrapChannel(SocketChannel channel, SelectionKey key)Allows to wrap the Socketchannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.-
Methods inherited from class org.java_websocket.server.DefaultSSLWebSocketServerFactory
close, createWebSocket, createWebSocket
-
-
-
-
Constructor Detail
-
CustomSSLWebSocketServerFactory
public CustomSSLWebSocketServerFactory(SSLContext sslContext, String[] enabledProtocols, String[] enabledCiphersuites)
New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.- Parameters:
sslContext- - can not benullenabledProtocols- - only these protocols are enabled, whennulldefault settings will be used.enabledCiphersuites- - only these cipher suites are enabled, whennulldefault settings will be used.
-
CustomSSLWebSocketServerFactory
public CustomSSLWebSocketServerFactory(SSLContext sslContext, ExecutorService executerService, String[] enabledProtocols, String[] enabledCiphersuites)
New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.- Parameters:
sslContext- - can not benullexecuterService- - can not benullenabledProtocols- - only these protocols are enabled, whennulldefault settings will be used.enabledCiphersuites- - only these cipher suites are enabled, whennulldefault settings will be used.
-
-
Method Detail
-
wrapChannel
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException
Description copied from interface:WebSocketServerFactoryAllows to wrap the Socketchannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.- Specified by:
wrapChannelin interfaceWebSocketServerFactory- Overrides:
wrapChannelin classDefaultSSLWebSocketServerFactory- Parameters:
channel- The SocketChannel to wrapkey- a SelectionKey of an open SocketChannel.- Returns:
- The channel on which the read and write operations will be performed.
- Throws:
IOException- may be thrown while writing on the channel
-
-