public class SSLContextConnection extends SocketConnection
closed, daemon, daemonContext, key, localAddr, localPort, protocolEngine, remoteAddr, remotePort, selectorThread, socketChannel, socketDataIn, socketDataOut
Constructor and Description |
---|
SSLContextConnection()
Default constructor.
|
SSLContextConnection(boolean allowClientCertificate,
boolean requireClientCertificate) |
Modifier and Type | Method and Description |
---|---|
static SSLContext |
getSSLContext()
Get the SSL context.
|
static void |
initializeSSL()
Initialize SSL.
|
boolean |
isConnected()
Is the socket still connected? During the initial handshake check the raw
socket status, otherwise check the protocol status.
|
protected boolean |
isDeferredConnectEvent() |
boolean |
processReadEvent()
This method is called when new network data arrives on the socket.
|
boolean |
processWriteEvent()
Write any application data to the socket by wrapping it up into the
SSL protocol.
|
void |
registrationCompleted(SelectableChannel channel,
SelectionKey key)
This method is called once the socket is registered with a SelectorThread.
|
static void |
setEnabledCipherSuites(String[] aCipherSuites) |
static void |
setEnabledProtocols(String[] aProtocols) |
closeConnection, getDaemonContext, getIdleStates, getInterestedOps, getLocalAddress, getLocalPort, getPort, getProtocolEngine, getRemoteAddress, getSocketChannel, getThread, getUuid, initialize, isSelectorThread, setSelectionKey, setThread, setWriteState
public SSLContextConnection()
public SSLContextConnection(boolean allowClientCertificate, boolean requireClientCertificate)
public void registrationCompleted(SelectableChannel channel, SelectionKey key)
registrationCompleted
in interface SelectorRegistrationListener
registrationCompleted
in class SocketConnection
channel
- SelectableChannelkey
- SelectionKeyselectorThread
- SelectorThreadprotected boolean isDeferredConnectEvent()
isDeferredConnectEvent
in class SocketConnection
public static SSLContext getSSLContext() throws IOException
Exception
IOException
public static void initializeSSL() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public boolean isConnected()
isConnected
in class SocketConnection
public boolean processReadEvent()
processReadEvent
in interface SocketHandler
processReadEvent
in class SocketConnection
applicationData
- ByteBufferpublic boolean processWriteEvent()
processWriteEvent
in interface SocketHandler
processWriteEvent
in class SocketConnection
applicationData
- ByteBufferpublic static void setEnabledProtocols(String[] aProtocols)
public static void setEnabledCipherSuites(String[] aCipherSuites)
Copyright © 2024. All rights reserved.