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:
- java.lang.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 |
buffOut, closeAsync, connectionTimeout, dataIn, dataOut, diffServChosen, dynamicManagement, ioBufferSize, jmxPort, localLocation, logWriterName, minmumWireFormatVersion, remoteLocation, socket, socketBufferSize, socketFactory, soTimeout, startLogging, stoppedLatch, trace, trafficClass, typeOfServiceChosen, useLocalHost, wireFormat |
Constructor Summary |
SslTransport(WireFormat wireFormat,
javax.net.ssl.SSLSocket socket)
Initialize from a ServerSocket. |
SslTransport(WireFormat wireFormat,
javax.net.ssl.SSLSocketFactory socketFactory,
java.net.URI remoteLocation,
java.net.URI localLocation,
boolean needClientAuth)
Connect to a remote node such as a Broker. |
Method Summary |
void |
doConsume(java.lang.Object command)
Overriding in order to add the client's certificates to ConnectionInfo
Commmands. |
java.security.cert.X509Certificate[] |
getPeerCertificates()
|
java.lang.String |
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, getSoTimeout, getTcpNoDelay, getTypeOfService, initialiseSocket, initializeStreams, isCloseAsync, isDynamicManagement, isStartLogging, isTrace, isUseLocalHost, narrow, oneway, readCommand, resolveHostName, run, setCloseAsync, setConnectionTimeout, setDiffServ, setDynamicManagement, setIoBufferSize, setJmxPort, setKeepAlive, setLogWriterName, setMinmumWireFormatVersion, setSocketBufferSize, setSocketOptions, setSoTimeout, setStartLogging, setTcpNoDelay, setTrace, setTypeOfService, setUseLocalHost, stop |
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 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 |
Methods inherited from interface org.apache.activemq.Service |
start |
SslTransport
public SslTransport(WireFormat wireFormat,
javax.net.ssl.SSLSocketFactory socketFactory,
java.net.URI remoteLocation,
java.net.URI localLocation,
boolean needClientAuth)
throws java.io.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:
java.net.UnknownHostException
- If TcpTransport throws.
java.io.IOException
- If TcpTransport throws.
SslTransport
public SslTransport(WireFormat wireFormat,
javax.net.ssl.SSLSocket socket)
throws java.io.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:
java.io.IOException
- If TcpTransport throws.
doConsume
public void doConsume(java.lang.Object command)
- Overriding in order to add the client's certificates to ConnectionInfo
Commmands.
- Overrides:
doConsume
in class TransportSupport
- Parameters:
command
- The Command coming in.
getPeerCertificates
public java.security.cert.X509Certificate[] getPeerCertificates()
- Returns:
- peer certificate chain associated with the ssl socket
toString
public java.lang.String toString()
- Overrides:
toString
in class TcpTransport
- Returns:
- pretty print of 'this'
Copyright © 2005-2011. All Rights Reserved.