T
- public class SslConnection<T extends Connector> extends Connection<T>
Constructor and Description |
---|
SslConnection(ConnectionHelper<T> helper,
SocketChannel socketChannel,
ConnectionController controller,
InetSocketAddress socketAddress,
SSLEngine sslEngine)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected ReadableSelectionChannel |
createReadableSelectionChannel()
Creates a new readable channel.
|
protected WritableSelectionChannel |
createWritableSelectionChannel()
Creates a new writable channel.
|
int |
getApplicationBufferSize()
Returns the suggested application buffer size.
|
int |
getInboundBufferSize()
Returns the size of the content buffer for receiving messages.
|
int |
getOutboundBufferSize()
Returns the size of the content buffer for sending responses.
|
int |
getPacketBufferSize()
Returns the suggested SSL packet buffer size.
|
InetSocketAddress |
getPeerAddress()
Returns the peer address.
|
String |
getSslCipherSuite()
Returns the SSL cipher suite.
|
List<Certificate> |
getSslClientCertificates()
Returns the list of client SSL certificates.
|
SSLEngine |
getSslEngine()
Returns the engine to use for wrapping and unwrapping.
|
SSLEngineResult |
getSslEngineResult()
Returns the engine result.
|
SSLEngineResult.Status |
getSslEngineStatus()
Returns the latest SSL engine status, or
SSLEngineResult.Status#OK otherwise. |
SSLEngineResult.HandshakeStatus |
getSslHandshakeStatus()
Returns the SSL handshake status, either from the latest engine result or
from the SSL engine.
|
Integer |
getSslKeySize()
Returns the SSL key size, if available and accessible.
|
SSLSession |
getSslSession()
Returns the current SSL session or null.
|
void |
handleSslResult()
Handles the result of a previous SSL engine processing.
|
void |
initSslEngine()
Initializes the SSL engine with the current SSL context and socket
address.
|
boolean |
isSslHandshaking()
Indicates if the SSL handshake is going on.
|
void |
reuse(SocketChannel socketChannel,
ConnectionController controller,
InetSocketAddress socketAddress)
Reuses the connection and associates it to the given socket.
|
void |
setPeerAddress(InetSocketAddress peerAddress)
Sets the peer address.
|
void |
setSslEngine(SSLEngine engine)
Sets the engine to use for wrapping and unwrapping.
|
protected void |
setSslEngineResult(SSLEngineResult engineResult)
Sets the engine result.
|
void |
setSslResult(SSLEngineResult sslResult)
Saves the result of a previous SSL engine processing.
|
protected void |
shutdown(Socket socket)
Shutdowns the socket, first its input then its output.
|
String |
toString() |
clear, close, commit, getAddress, getHelper, getInboundWay, getLastActivity, getLoadScore, getLogger, getMaxIoIdleTimeMs, getOutboundWay, getPort, getReadableSelectionChannel, getRegistration, getSocket, getSocketAddress, getSocketChannel, getState, getWritableSelectionChannel, hasTimedOut, init, isAvailable, isClientSide, isEmpty, isPersistent, isPipelining, isReady, isServerSide, onActivity, onError, onSelected, onTimeOut, open, setPersistent, setPipelining, setRegistration, setState, updateState
public SslConnection(ConnectionHelper<T> helper, SocketChannel socketChannel, ConnectionController controller, InetSocketAddress socketAddress, SSLEngine sslEngine) throws IOException
helper
- The parent connector helper.socketChannel
- The underlying NIO socket channel.controller
- The IO controller.socketAddress
- The associated IP address.IOException
protected ReadableSelectionChannel createReadableSelectionChannel()
Connection
createReadableSelectionChannel
in class Connection<T extends Connector>
protected WritableSelectionChannel createWritableSelectionChannel()
Connection
createWritableSelectionChannel
in class Connection<T extends Connector>
public int getApplicationBufferSize()
public int getInboundBufferSize()
Connection
Connection.getInboundBufferSize()
.getInboundBufferSize
in class Connection<T extends Connector>
public int getOutboundBufferSize()
Connection
Connection.getOutboundBufferSize()
.getOutboundBufferSize
in class Connection<T extends Connector>
public int getPacketBufferSize()
public InetSocketAddress getPeerAddress()
public String getSslCipherSuite()
public List<Certificate> getSslClientCertificates()
public SSLEngine getSslEngine()
public SSLEngineResult getSslEngineResult()
public SSLEngineResult.Status getSslEngineStatus()
SSLEngineResult.Status#OK
otherwise.public SSLEngineResult.HandshakeStatus getSslHandshakeStatus()
public Integer getSslKeySize()
public SSLSession getSslSession()
public void handleSslResult() throws IOException
IOException
public void initSslEngine() throws SSLException
SSLException
public boolean isSslHandshaking()
public void reuse(SocketChannel socketChannel, ConnectionController controller, InetSocketAddress socketAddress) throws IOException
Connection
reuse
in class Connection<T extends Connector>
socketChannel
- The underlying NIO socket channel.controller
- The underlying IO controller.socketAddress
- The associated socket address.IOException
public void setPeerAddress(InetSocketAddress peerAddress)
peerAddress
- The peer address.public void setSslEngine(SSLEngine engine)
engine
- The engine to use for wrapping and unwrapping.protected void setSslEngineResult(SSLEngineResult engineResult)
engineResult
- The engine result.public void setSslResult(SSLEngineResult sslResult) throws IOException
sslResult
- The SSL result to handle.IOException
protected void shutdown(Socket socket) throws IOException
Connection
shutdown
in class Connection<T extends Connector>
socket
- The socket to shutdown.IOException
public String toString()
toString
in class Connection<T extends Connector>
Copyright © 2005–2019. All rights reserved.