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
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
ConstructorsConstructorDescriptionCustomSSLWebSocketServerFactory(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
Modifier and TypeMethodDescriptionwrapChannel(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 Details
-
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 Details
-
wrapChannel
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
-