Class NIOSSLTransport
-
- Direct Known Subclasses:
AmqpNioSslTransport
,AutoInitNioSSLTransport
,MQTTNIOSSLTransport
,StompNIOSSLTransport
public class NIOSSLTransport extends NIOTransport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.transport.tcp.TcpTransport
TcpTransport.InitBuffer
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]
enabledCipherSuites
protected String[]
enabledProtocols
protected boolean
handshakeInProgress
protected SSLEngineResult.HandshakeStatus
handshakeStatus
protected CountDownLatch
initialized
protected boolean
needClientAuth
protected SSLContext
sslContext
protected SSLEngine
sslEngine
protected SSLSession
sslSession
protected SSLEngineResult.Status
status
protected TaskRunnerFactory
taskRunnerFactory
protected boolean
verifyHostName
protected boolean
wantClientAuth
-
Fields inherited from class org.apache.activemq.transport.nio.NIOTransport
channel, currentBuffer, inputBuffer, nextFrameSize, selection
-
Fields inherited from class org.apache.activemq.transport.tcp.TcpTransport
buffOut, closeAsync, connectionTimeout, dataIn, dataOut, diffServChosen, dynamicManagement, initBuffer, ioBufferSize, jmxPort, localLocation, logWriterName, minmumWireFormatVersion, receiveCounter, remoteLocation, socket, socketBufferSize, socketFactory, socketOptions, soTimeout, startLogging, stoppedLatch, trace, trafficClass, typeOfServiceChosen, useLocalHost, wireFormat
-
-
Constructor Summary
Constructors Constructor Description NIOSSLTransport(WireFormat wireFormat, Socket socket, SSLEngine engine, TcpTransport.InitBuffer initBuffer, ByteBuffer inputBuffer)
NIOSSLTransport(WireFormat wireFormat, SocketFactory socketFactory, URI remoteLocation, URI localLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doConsume(Object command)
Overriding in order to add the client's certificates to ConnectionInfo Commands.protected void
doHandshake()
protected void
doInit()
protected void
doOpenWireInit()
protected void
doStart()
protected void
doStop(ServiceStopper stopper)
protected void
finishHandshake()
String[]
getEnabledCipherSuites()
String[]
getEnabledProtocols()
X509Certificate[]
getPeerCertificates()
protected void
initializeStreams()
boolean
isNeedClientAuth()
boolean
isVerifyHostName()
boolean
isWantClientAuth()
protected void
processCommand(ByteBuffer plain)
protected int
secureRead(ByteBuffer plain)
void
serviceRead()
void
setEnabledCipherSuites(String[] enabledCipherSuites)
void
setEnabledProtocols(String[] enabledProtocols)
void
setNeedClientAuth(boolean needClientAuth)
void
setSslContext(SSLContext sslContext)
void
setVerifyHostName(boolean verifyHostName)
void
setWantClientAuth(boolean wantClientAuth)
-
Methods inherited from class org.apache.activemq.transport.nio.NIOTransport
readFromBuffer
-
Methods inherited from class org.apache.activemq.transport.tcp.TcpTransport
closeStreams, connect, doRun, getConnectionTimeout, getDiffServ, getIoBufferSize, getJmxPort, getKeepAlive, getLogWriterName, getMinmumWireFormatVersion, getReceiveCounter, getRemoteAddress, getSocketBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTypeOfService, getWireFormat, initialiseSocket, isCloseAsync, isDynamicManagement, isStartLogging, isTrace, isUseLocalHost, narrow, oneway, readCommand, resolveHostName, run, setCloseAsync, setConnectionTimeout, setDiffServ, setDynamicManagement, setIoBufferSize, setJmxPort, setKeepAlive, setLogWriterName, setMinmumWireFormatVersion, setPeerCertificates, setSocketBufferSize, setSocketOptions, setSoLinger, setSoTimeout, setStartLogging, setTcpNoDelay, setTrace, setTypeOfService, setUseLocalHost, stop, toString
-
Methods inherited from class org.apache.activemq.transport.TransportThreadSupport
getStackSize, isDaemon, setDaemon, setStackSize
-
Methods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, onException, reconnect, request, request, setTransportListener, updateURIs
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.Transport
asyncRequest, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, reconnect, request, request, setTransportListener, updateURIs
-
-
-
-
Field Detail
-
needClientAuth
protected boolean needClientAuth
-
wantClientAuth
protected boolean wantClientAuth
-
enabledCipherSuites
protected String[] enabledCipherSuites
-
enabledProtocols
protected String[] enabledProtocols
-
verifyHostName
protected boolean verifyHostName
-
sslContext
protected SSLContext sslContext
-
sslEngine
protected SSLEngine sslEngine
-
sslSession
protected SSLSession sslSession
-
handshakeInProgress
protected volatile boolean handshakeInProgress
-
status
protected SSLEngineResult.Status status
-
handshakeStatus
protected SSLEngineResult.HandshakeStatus handshakeStatus
-
taskRunnerFactory
protected TaskRunnerFactory taskRunnerFactory
-
initialized
protected final CountDownLatch initialized
-
-
Constructor Detail
-
NIOSSLTransport
public NIOSSLTransport(WireFormat wireFormat, SocketFactory socketFactory, URI remoteLocation, URI localLocation) throws UnknownHostException, IOException
- Throws:
UnknownHostException
IOException
-
NIOSSLTransport
public NIOSSLTransport(WireFormat wireFormat, Socket socket, SSLEngine engine, TcpTransport.InitBuffer initBuffer, ByteBuffer inputBuffer) throws IOException
- Throws:
IOException
-
-
Method Detail
-
setSslContext
public void setSslContext(SSLContext sslContext)
-
initializeStreams
protected void initializeStreams() throws IOException
- Overrides:
initializeStreams
in classNIOTransport
- Throws:
IOException
-
serviceRead
public void serviceRead()
- Overrides:
serviceRead
in classNIOTransport
-
processCommand
protected void processCommand(ByteBuffer plain) throws Exception
- Throws:
Exception
-
secureRead
protected int secureRead(ByteBuffer plain) throws Exception
- Throws:
Exception
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classNIOTransport
- Throws:
Exception
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Overrides:
doStop
in classNIOTransport
- Throws:
Exception
-
doConsume
public void doConsume(Object command)
Overriding in order to add the client's certificates to ConnectionInfo Commands.- Overrides:
doConsume
in classTransportSupport
- Parameters:
command
- The Command coming in.
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
- Specified by:
getPeerCertificates
in interfaceTransport
- Overrides:
getPeerCertificates
in classTcpTransport
- Returns:
- peer certificate chain associated with the ssl socket
-
isNeedClientAuth
public boolean isNeedClientAuth()
-
setNeedClientAuth
public void setNeedClientAuth(boolean needClientAuth)
-
isWantClientAuth
public boolean isWantClientAuth()
-
setWantClientAuth
public void setWantClientAuth(boolean wantClientAuth)
-
getEnabledCipherSuites
public String[] getEnabledCipherSuites()
-
setEnabledCipherSuites
public void setEnabledCipherSuites(String[] enabledCipherSuites)
-
getEnabledProtocols
public String[] getEnabledProtocols()
-
setEnabledProtocols
public void setEnabledProtocols(String[] enabledProtocols)
-
isVerifyHostName
public boolean isVerifyHostName()
-
setVerifyHostName
public void setVerifyHostName(boolean verifyHostName)
-
-