//if the WebSocket connection URI is wss then start SSL TLS handshaking
if (req.getUri().startsWith("wss:")) {
// Get the SslHandler in the current pipeline.
final SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
// Get notified when SSL handshake is done.
ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new SecureWebSocketConnectionListener(sslHandler));
}
// initialize the connector
connector = initializeConnector(ctx, req);