Class SslTransport
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.transport.TransportSupport
org.apache.activemq.transport.TransportThreadSupport
org.apache.activemq.transport.tcp.TcpTransport
org.apache.activemq.transport.tcp.SslTransport
A Transport class that uses SSL and client-side certificate authentication.
Client-side certificate authentication must be enabled through the
constructor. By default, this class will have the same client authentication
behavior as the socket it is passed. This class will set ConnectionInfo's
transportContext to the SSL certificates of the client. NOTE: Accessor method
for needClientAuth was not provided on purpose. This is because
needClientAuth's value must be set before the socket is connected. Otherwise,
unexpected situations may occur.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.activemq.transport.tcp.TcpTransport
TcpTransport.InitBuffer -
Field Summary
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
ConstructorsConstructorDescriptionSslTransport(WireFormat wireFormat, SSLSocket socket) Initialize from a ServerSocket.SslTransport(WireFormat wireFormat, SSLSocketFactory socketFactory, URI remoteLocation, URI localLocation, boolean needClientAuth) Connect to a remote node such as a Broker.SslTransport(WireFormat format, SSLSocket socket, TcpTransport.InitBuffer initBuffer) -
Method Summary
Modifier and TypeMethodDescriptionvoidOverriding in order to add the client's certificates to ConnectionInfo Commmands.protected voidinitialiseSocket(Socket sock) Configures the socket for usevoidsetVerifyHostName(Boolean verifyHostName) toString()Methods inherited from class org.apache.activemq.transport.tcp.TcpTransport
closeStreams, connect, doRun, doStart, doStop, getConnectionTimeout, getDiffServ, getIoBufferSize, getJmxPort, getKeepAlive, getLogWriterName, getMinmumWireFormatVersion, getReceiveCounter, getRemoteAddress, getSocketBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTypeOfService, getWireFormat, initializeStreams, 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, stopMethods inherited from class org.apache.activemq.transport.TransportThreadSupport
getStackSize, isDaemon, setDaemon, setStackSizeMethods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, onException, reconnect, request, request, setTransportListener, updateURIsMethods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.transport.Transport
asyncRequest, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, reconnect, request, request, setTransportListener, updateURIs
-
Constructor Details
-
SslTransport
public SslTransport(WireFormat wireFormat, SSLSocketFactory socketFactory, URI remoteLocation, URI localLocation, boolean needClientAuth) throws IOException Connect to a remote node such as a Broker.- Parameters:
wireFormat- The WireFormat to be used.socketFactory- The socket factory to be used. Forcing SSLSockets for obvious reasons.remoteLocation- The remote location.localLocation- The local location.needClientAuth- If set to true, the underlying socket will need client certificate authentication.- Throws:
UnknownHostException- If TcpTransport throws.IOException- If TcpTransport throws.
-
SslTransport
Initialize from a ServerSocket. No access to needClientAuth is given since it is already set within the provided socket.- Parameters:
wireFormat- The WireFormat to be used.socket- The Socket to be used. Forcing SSL.- Throws:
IOException- If TcpTransport throws.
-
SslTransport
public SslTransport(WireFormat format, SSLSocket socket, TcpTransport.InitBuffer initBuffer) throws IOException - Throws:
IOException
-
-
Method Details
-
initialiseSocket
Description copied from class:TcpTransportConfigures the socket for use- Overrides:
initialiseSocketin classTcpTransport- Parameters:
sock- the socket- Throws:
SocketExceptionIllegalArgumentException
-
doConsume
Overriding in order to add the client's certificates to ConnectionInfo Commmands.- Overrides:
doConsumein classTransportSupport- Parameters:
command- The Command coming in.
-
setVerifyHostName
-
getPeerCertificates
- Specified by:
getPeerCertificatesin interfaceTransport- Overrides:
getPeerCertificatesin classTcpTransport- Returns:
- peer certificate chain associated with the ssl socket
-
toString
- Overrides:
toStringin classTcpTransport- Returns:
- pretty print of 'this'
-