org.apache.activemq.transport.tcp
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
- All Implemented Interfaces:
- Runnable, Service, Transport
public class SslTransport
- extends TcpTransport
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.
Fields inherited from class org.apache.activemq.transport.tcp.TcpTransport |
connectionTimeout, dataIn, dataOut, ioBufferSize, localLocation, minmumWireFormatVersion, remoteLocation, socket, socketBufferSize, socketFactory, soTimeout, trace, useLocalHost, wireFormat |
Methods inherited from class org.apache.activemq.transport.tcp.TcpTransport |
closeStreams, connect, doStart, doStop, getConnectionTimeout, getIoBufferSize, getKeepAlive, getMinmumWireFormatVersion, getRemoteAddress, getSocketBufferSize, getSoTimeout, getTcpNoDelay, initialiseSocket, initializeStreams, isTrace, isUseLocalHost, oneway, readCommand, resolveHostName, run, setConnectionTimeout, setIoBufferSize, setKeepAlive, setMinmumWireFormatVersion, setSocketBufferSize, setSocketOptions, setSoTimeout, setTcpNoDelay, setTrace, setUseLocalHost |
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
public SslTransport(WireFormat wireFormat,
SSLSocket socket)
throws IOException
- 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.
doConsume
public void doConsume(Command command)
- Overriding in order to add the client's certificates to ConnectionInfo Commmands.
- Parameters:
command
- The Command coming in.
toString
public String toString()
- Overrides:
toString
in class TcpTransport
- Returns:
- pretty print of 'this'
Copyright © 2011 Apache Software Foundation. All Rights Reserved.