activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Setting SSL timeout value
Date Tue, 18 Apr 2006 09:11:24 GMT
If you want to change the value of soTimeout on the SSL socket you can
use the URI syntax...

http://activemq.org/TCP+Transport+Reference

e.g.

ssl://host:port?soTimeout=9000


On 4/14/06, Jason P <cobraconn@yahoo.com> wrote:
>
> Is there an easy way to set the SSL timeout value used by the Transport
> classes?  I have a client application that can connect up via SSL fine
> unless it runs on a slow machine.  I set javax.net.debug=all and can see
> that on the SSL connection that fails the timeout value is getting set to
> 500 ms:
>
> sslsocket: SSLSocket.setSoTimeout()
> sslsocket: timeout = 500
>
> Here as a trace excerpt from my client application.  Anything prefixed with
> a "PT:" is a log statement I added to the ActiveMQ source.  The second
> sslsocket: timeout value listed is the one I'm concerned with (it should be
> in bold):
>
> 04/14/06 11:37:12.844 DEBUG [Thread-0] - Creating ActiveMQConnectionFactory
> using URL: ssl://10.0.1.9:3066
> 04/14/06 11:37:13.568 DEBUG [Thread-0] - Creating ActiveMQ Connection.
> 04/14/06 11:37:13.573 DEBUG [Thread-0] - PT: Enter
> ActiveMQConnectionFactory.createActiveMQConnection()
> 04/14/06 11:37:13.574 DEBUG [Thread-0] - PT: Creating Transport instance by
> using TransportFactory to connect to broker URL "ssl://10.0.1.9:3066".
> 04/14/06 11:37:13.805 DEBUG [Thread-0] - PT: Enter
> TransportFactory.connect(URI location, Executor ex)
> 04/14/06 11:37:13.813 DEBUG [Thread-0] - PT: Enter
> TransportFactory.findTransportFactory(URI location)
> 04/14/06 11:37:13.814 DEBUG [Thread-0] - PT: Getting Scheme from
> locationURI: ssl://10.0.1.9:3066
> 04/14/06 11:37:13.815 DEBUG [Thread-0] - PT: Getting TransportFactory for
> scheme "ssl".
> 04/14/06 11:37:13.816 DEBUG [Thread-0] - PT: TransportFactory is null.
> 04/14/06 11:37:13.817 DEBUG [Thread-0] - PT: Attempting to create new
> TransportFactory for scheme "ssl".
> 04/14/06 11:37:14.005 DEBUG [Thread-0] - PT: Adding newly created
> TransportFactory to TransportFactory list.
> 04/14/06 11:37:14.013 DEBUG [Thread-0] - PT: Returning TransportFactroy for
> scheme "ssl".
> 04/14/06 11:37:14.014 DEBUG [Thread-0] - PT: Leave
> TransportFactory.findTransportFactory(URI location)
> 04/14/06 11:37:14.015 DEBUG [Thread-0] - PT: Leave
> TransportFactory.connect(URI location, Executor ex)
> 04/14/06 11:37:14.016 DEBUG [Thread-0] - PT: Enter
> TransportFactory.createWireFormat(Map options)
> 04/14/06 11:37:14.022 DEBUG [Thread-0] - PT: Creating WireFormatFactory.
> 04/14/06 11:37:14.026 DEBUG [Thread-0] - PT: Enter
> TransportFactory.createWireFormatFactory(Map options)
> 04/14/06 11:37:14.027 DEBUG [Thread-0] - PT: WireFormat not specified in
> options.
> 04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Getting default WireFormat.
> 04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Creating new WireFormatFactory
> instance for WireFormat "default".
> 04/14/06 11:37:14.073 DEBUG [Thread-0] - PT: Setting properties of
> IntrospectionSupport.
> 04/14/06 11:37:14.103 DEBUG [Thread-0] - PT: Leave
> TransportFactory.createWireFormatFactory(Map options)
> 04/14/06 11:37:14.106 DEBUG [Thread-0] - PT: Creating WireFormat.
> 04/14/06 11:37:14.986 DEBUG [Thread-0] - PT: Leave
> TransportFactory.createWireFormat(Map options)
> sslctx: Context created.
> sslctx: Supported protocols:
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslctx: Supported cipher suites:
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> SSL_RSA_WITH_NULL_MD5
> SSL_RSA_WITH_NULL_SHA
> }
> sslctx: Default cipher suites:
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> }
> sslctx: SSLContext.init()
> sslctx: KeyManager[0] class = com.ibm.jsse.bg
> sslctx: TrustManager[0] class = com.ibm.jsse.bi
> sslctx: SSLContext.getSocketFactory()
> socketfactory: Socket factory created.
> socketfactory: SSLSocketFactory.createSocket()
> socketfactory: host = 10.0.1.9
> socketfactory: port = 3066
> sslsocket: SSL Socket created.
> sslsocket: host = 10.0.1.9
> sslsocket: port = 3066
> sslctx: SSLContextImpl.isInitialized()
> sslctx: SSLContextImpl.initialize()
> sslctx: SSLConfiguration = null
> sslctx: SSLContextImpl.getCertifcateChainAlias()
> sslctx: Certificate authorities list = null
> sslctx: Server = true
> sslctx: SSLContextImpl.getCertificateChain()
> sslctx: Alias = compliancemonitor
> sslctx: SSLContextImpl.getPrivateKey()
> sslctx: Alias = compliancemonitor
> sslctx: SSLContextImpl.getDefaultCipherSuites()
> sslctx: SSLContextImpl.getSupportedProtocols()
> sslsocket: SSLSocket.setEnabledProtocols()
> sslsocket: protocols =
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslctx: SSLContextImpl.validateProtocols()
> sslctx: Protocols:
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslsocket: SSLSocketImpl.init()
> sslsocket: roleIsServer = false
> sslsocket: enabledCipherSuites =
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> }
> sslsocket: enabledProtocols =
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslsocket: SSLSocket.connect()
> sslsocket: endpoint = /10.0.1.9:3066
> sslsocket: timeout = 0
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLSocket.getInputStream()
> sslsocket: SSLSocket.isClosed()
> sslinput: Input stream created.
> sslsess: SSLSession.getCipherSuite()
> sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
> sslsocket: SSLSocket.isConnected()
> sslinput: conn = [SSL_NULL_WITH_NULL_NULL:
> Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]]
> sslsocket: SSLSocket.getOutputStream()
> sslsocket: SSLSocket.isClosed()
> ssloutput: Output stream created.
> sslsess: SSLSession.getCipherSuite()
> sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
> sslsocket: SSLSocket.isConnected()
> ssloutput: conn = [SSL_NULL_WITH_NULL_NULL:
> Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]]
> sslsocket: SSLSocket.setReceiveBufferSize()
> sslsocket: size = 65536
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLSocket.setSendBufferSize()
> sslsocket: size = 65536
> sslsocket: SSLSocket.isClosed()
> 04/14/06 11:37:16.273 DEBUG [Thread-0] - PT: Creating ActiveMQConnection
> using Transport instance and Factory Stats stats{ unit:
> many startTime: 1145039833545 lastSampleTime: 1145039833545 description:
> Used only as container, not Statistic }
> 04/14/06 11:37:16.613 DEBUG [Thread-0] - PT: Setting connection username:
> jasonp
> 04/14/06 11:37:16.614 DEBUG [Thread-0] - PT: Setting connection password.
> 04/14/06 11:37:16.615 DEBUG [Thread-0] - PT: Setting connection
> PrefetchPolicy: org.apache.activemq.ActiveMQPrefetchPolicy@7bdb42d8
> 04/14/06 11:37:16.616 DEBUG [Thread-0] - PT: Setting connection
> DisableTimeStampsByDefault: false
> 04/14/06 11:37:16.617 DEBUG [Thread-0] - PT: Setting connection
> OnSendPrepareMessageBody: true
> 04/14/06 11:37:16.623 DEBUG [Thread-0] - PT: Setting connection
> OptimizedMessageDispatch: true
> 04/14/06 11:37:16.624 DEBUG [Thread-0] - PT: Setting connection
> CopyMessageOnSend: true
> 04/14/06 11:37:16.625 DEBUG [Thread-0] - PT: Setting connection
> UseCompression: false
> 04/14/06 11:37:16.626 DEBUG [Thread-0] - PT: Setting connection
> ObjectMessageSerializationDefered: false
> 04/14/06 11:37:16.627 DEBUG [Thread-0] - PT: Setting connection
> AsyncDispatch: true
> 04/14/06 11:37:16.633 DEBUG [Thread-0] - PT: Setting connection
> UseAsyncSend: false
> 04/14/06 11:37:16.634 DEBUG [Thread-0] - PT: Setting connection
> UseRetroactiveConsumer: false
> 04/14/06 11:37:16.635 DEBUG [Thread-0] - PT: Setting connection
> RedeliveryPolicy: org.apache.activemq.RedeliveryPolicy@7bdb42a8
> 04/14/06 11:37:16.636 DEBUG [Thread-0] - PT: Starting Transport.
> 04/14/06 11:37:16.637 DEBUG [Thread-0] - PT: Transport Class: class
> org.apache.activemq.transport.ResponseCorrelator
> sslsocket: SSLSocket.isBound()
> sslsocket: SSLSocket.getLocalAddress()
> sslsocket: SSLSocket.isBound()
> ssloutput: SSLOutputStream.write()
> ssloutput: data =
> Invalid buffer
> sslsocket: SSLSocketImpl.write()
> sslsocket: len = 22
> sslsocket: SSLSocket.startHandshake()
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLServerSocket.getLocalPort()
> sslsocket: SSLSocket.isBound()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLServerSocket.getInetAddress()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLServerSocket.getPort()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLSocket.setSoTimeout()
> sslsocket: timeout = 500
> sslctx: SSLContextImpl.validateCertificateChain()
> sslctx: Certificate chain = [[B@33b085fb
> sslctx: Certificate[0] = [B@121efcdf
> sslctx: Server = false
> sslsocket: SSLServerSocket.getHost()
> sslsess: Session created.
> 04/14/06 11:37:16.896 DEBUG [Thread-0] - Leave
> ActiveMQConnectionFactory.createActiveMQConnection()
> 04/14/06 11:37:16.897 DEBUG [Thread-0] - Registering as an ExceptionListener
> for ActiveMQConnection.
> 04/14/06 11:37:16.902 DEBUG [Thread-0] - Starting ActiveMQ Connection.
> sslsocket: SSLSocket.isClosed()
> sslinput: SSLInputStream.read()
> sslinput: off = 0
> sslinput: len = 65536
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 0
> sslsocket: len = 65536
> sslinput: data =
> Invalid buffer
> sslinput: rc = 22
> 04/14/06 11:37:16.940 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT: WireFormatInfo:
> 04/14/06 11:37:16.946 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   CommandId: 0
> 04/14/06 11:37:16.947 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Options: 5
> 04/14/06 11:37:16.948 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Version: 1
> 04/14/06 11:37:16.949 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   DataStructureType: 1
> 04/14/06 11:37:16.950 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Magic: [B@4bd53392
> 04/14/06 11:37:16.953 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isBrokerInfo: false
> 04/14/06 11:37:16.954 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isCacheEnabled: true
> 04/14/06 11:37:16.955 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMarshallAware: false
> 04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessage: false
> 04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageAck: false
> 04/14/06 11:37:16.963 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatch: false
> 04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatchNotification: false
> 04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isResponse: false
> 04/14/06 11:37:16.965 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isResponseRequired: false
> 04/14/06 11:37:16.966 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isShutdownInfo: false
> 04/14/06 11:37:16.967 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isStackTraceEnabled: true
> 04/14/06 11:37:16.973 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isTcpNoDelay: false
> 04/14/06 11:37:16.974 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isValid: true
> 04/14/06 11:37:16.975 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isWireFormatInfo: true
> sslinput: SSLInputStream.read()
> sslinput: off = 22
> sslinput: len = 65514
> ssloutput: SSLOutputStream.write()
> ssloutput: data =
> Invalid buffer
> sslsocket: SSLSocketImpl.write()
> sslsocket: len = 126
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 22
> sslsocket: len = 65514
> sslinput: data =
>    N  Þ     |  ID:Jasonp-2266-1145033060140-0:0  ssl://localhost:3066
> localhost
> sslinput: rc = 82
> sslinput: SSLInputStream.read()
> sslinput: off = 104
> sslinput: len = 65432
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 104
> sslsocket: len = 65432
> 04/14/06 11:37:17.554 ERROR [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - ActiveMQ JMS Exception occured.
> javax.jms.JMSException: Read timed out
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at javax.jms.JMSException.<init>(JMSException.java:35)
>         at javax.jms.JMSException.<init>(JMSException.java:41)
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:45)
>         at
> org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1327)
>         at
> org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1337)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:96)
>         at
> org.apache.activemq.transport.activeio.ActiveIOTransport$1.onError(ActiveIOTransport.java:100)
>         at
> org.activeio.command.AsyncChannelToAsyncCommandChannel$1.onPacketError(AsyncChannelToAsyncCommandChannel.java:78)
>         at
> org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
>         at
> org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
>         at
> org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:159)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
>         at java.lang.Thread.run(Thread.java:534)
> Caused by: java.io.InterruptedIOException: Read timed out
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at java.io.IOException.<init>(IOException.java:40)
>         at
> java.io.InterruptedIOException.<init>(InterruptedIOException.java:45)
>         at
> com.ibm.as400.ibmonly.net.ssl.SSLSocketImpl.read(SSLSocketImpl.java:652)
>         at
> com.ibm.as400.ibmonly.net.ssl.SSLInputStream.read(SSLInputStream.java:133)
>         at
> org.activeio.net.SocketStreamChannel.read(SocketStreamChannel.java:208)
>         at
> org.activeio.net.SocketSyncChannel.read(SocketSyncChannel.java:79)
>         at
> org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:145)
>         ... 3 more
> ssloutput: SSLOutputStream.close()
> sslsocket: SSLServerSocket.close()
> sslsocket: SSLSocket.isClosed()
> sslinput: SSLInputStream.close()
> sslsocket: SSLServerSocket.close()
> sslsocket: SSLServerSocket.close()
>
>
> --
> View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3922290
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message