Top Description Fields Constructors Methods
org.java_websocket.server

public Class CustomSSLWebSocketServerFactory

extends DefaultSSLWebSocketServerFactory
Class Inheritance
Imports
java.io.IOException, java.nio.channels.ByteChannel, .SelectionKey, .SocketChannel, java.util.concurrent.ExecutorService, .Executors, javax.net.ssl.SSLContext, .SSLEngine, org.java_websocket.SSLSocketChannel2

WebSocketFactory that can be configured to only support specific protocols and cipher suites.

Field Summary

Modifier and TypeField and Description
private final String[]
enabledCiphersuites

The enabled ciphersuites saved as a String array

private final String[]
enabledProtocols

The enabled protocols saved as a String array

Inherited from org.java_websocket.server.DefaultSSLWebSocketServerFactory:
execsslcontext

Constructor Summary

AccessConstructor and Description
public
CustomSSLWebSocketServerFactory(SSLContext
- can not be null
sslContext
,
String[]
- only these protocols are enabled, when null default settings will be used.
enabledProtocols
,
String[]
- only these cipher suites are enabled, when null default settings will be used.
enabledCiphersuites
)

New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.

public
CustomSSLWebSocketServerFactory(SSLContext
- can not be null
sslContext
,
ExecutorService
- can not be null
executerService
,
String[]
- only these protocols are enabled, when null default settings will be used.
enabledProtocols
,
String[]
- only these cipher suites are enabled, when null default settings will be used.
enabledCiphersuites
)

New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.

Method Summary

Modifier and TypeMethod and Description
public ByteChannel
wrapChannel(SocketChannel channel, SelectionKey key)

Overrides org.java_websocket.server.DefaultSSLWebSocketServerFactory.wrapChannel.

Implements org.java_websocket.WebSocketServerFactory.wrapChannel.

Allows to wrap the SocketChannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.

Inherited from org.java_websocket.server.DefaultSSLWebSocketServerFactory:
closecreateWebSocketcreateWebSocket

Field Detail

enabledCiphersuitesback to summary
private final String[] enabledCiphersuites

The enabled ciphersuites saved as a String array

enabledProtocolsback to summary
private final String[] enabledProtocols

The enabled protocols saved as a String array

Constructor Detail

CustomSSLWebSocketServerFactoryback to summary
public CustomSSLWebSocketServerFactory(SSLContext sslContext, String[] enabledProtocols, String[] enabledCiphersuites)

New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.

Parameters
sslContext:SSLContext

- can not be null

enabledProtocols:String[]

- only these protocols are enabled, when null default settings will be used.

enabledCiphersuites:String[]

- only these cipher suites are enabled, when null default settings will be used.

CustomSSLWebSocketServerFactoryback to summary
public CustomSSLWebSocketServerFactory(SSLContext sslContext, ExecutorService executerService, String[] enabledProtocols, String[] enabledCiphersuites)

New CustomSSLWebSocketServerFactory configured to only support given protocols and given cipher suites.

Parameters
sslContext:SSLContext

- can not be null

executerService:ExecutorService

- can not be null

enabledProtocols:String[]

- only these protocols are enabled, when null default settings will be used.

enabledCiphersuites:String[]

- only these cipher suites are enabled, when null default settings will be used.

Method Detail

wrapChannelback to summary
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException

Overrides org.java_websocket.server.DefaultSSLWebSocketServerFactory.wrapChannel.

Implements org.java_websocket.WebSocketServerFactory.wrapChannel.

Doc from org.java_websocket.WebSocketServerFactory.wrapChannel.

Allows to wrap the SocketChannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.

Annotations
@Override
Exceptions
IOException:
may be thrown while writing on the channel