public class TcpNioSSLConnection extends TcpNioConnection
TcpConnection
supporting SSL/TLS over NIO.
Unlike TcpNetConnection, which uses Sockets, the JVM does not directly support SSL for
SocketChannels, used by NIO. Instead, the SSLEngine is provided whereby the SSL
encryption is performed by passing in a plain text buffer, and receiving an
encrypted buffer to transmit over the network. Similarly, encrypted data read from
the network is decrypted.However, before this can be done, certain handshaking operations are required, involving the creation of data buffers which must be exchanged by the peers. A number of such transfers are required; once the handshake is finished, it is relatively simple to encrypt/decrypt the data.
Also, it may be deemed necessary to re-perform handshaking.
This class supports the management of handshaking as necessary, both from the initiating and receiving peers.
logger
Constructor and Description |
---|
TcpNioSSLConnection(java.nio.channels.SocketChannel socketChannel,
boolean server,
boolean lookupHost,
org.springframework.context.ApplicationEventPublisher applicationEventPublisher,
java.lang.String connectionFactoryName,
javax.net.ssl.SSLEngine sslEngine) |
TcpNioSSLConnection(java.nio.channels.SocketChannel socketChannel,
boolean server,
boolean lookupHost,
javax.net.ssl.SSLEngine sslEngine)
Deprecated.
Use
TcpNioSSLConnection(SocketChannel, boolean, boolean, ApplicationEventPublisher, String, SSLEngine)
TODO: Remove in 3.1/4.0 |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream |
getChannelOutputStream() |
protected org.springframework.integration.ip.tcp.connection.TcpNioSSLConnection.SSLChannelOutputStream |
getSSLChannelOutputStream() |
void |
init()
Initializes the SSLEngine and sets up the encryption/decryption buffers.
|
protected void |
sendToPipe(java.nio.ByteBuffer networkBuffer)
Overrides super class method to perform decryption and/or participate
in handshaking.
|
allocate, close, getDeserializerStateKey, getLastRead, getLastSend, getPayload, getPort, isOpen, isUsingDirectBuffers, readPacket, run, send, setLastRead, setPipeTimeout, setTaskExecutor, setUsingDirectBuffers
afterSend, closeConnection, getConnectionId, getDeserializer, getHostAddress, getHostName, getListener, getMapper, getSender, getSerializer, incrementAndGetConnectionSequence, isNoReadErrorOnClose, isServer, isSingleUse, publishConnectionCloseEvent, publishConnectionExceptionEvent, publishConnectionOpenEvent, publishEvent, registerListener, registerSender, sendExceptionToListener, setDeserializer, setMapper, setNoReadErrorOnClose, setSerializer, setSingleUse
@Deprecated public TcpNioSSLConnection(java.nio.channels.SocketChannel socketChannel, boolean server, boolean lookupHost, javax.net.ssl.SSLEngine sslEngine) throws java.lang.Exception
TcpNioSSLConnection(SocketChannel, boolean, boolean, ApplicationEventPublisher, String, SSLEngine)
TODO: Remove in 3.1/4.0java.lang.Exception
public TcpNioSSLConnection(java.nio.channels.SocketChannel socketChannel, boolean server, boolean lookupHost, org.springframework.context.ApplicationEventPublisher applicationEventPublisher, java.lang.String connectionFactoryName, javax.net.ssl.SSLEngine sslEngine) throws java.lang.Exception
java.lang.Exception
protected void sendToPipe(java.nio.ByteBuffer networkBuffer) throws java.io.IOException
sendToPipe
in class TcpNioConnection
java.io.IOException
public void init() throws java.io.IOException
java.io.IOException
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream getChannelOutputStream()
getChannelOutputStream
in class TcpNioConnection
protected org.springframework.integration.ip.tcp.connection.TcpNioSSLConnection.SSLChannelOutputStream getSSLChannelOutputStream()