Unfortunately it is a bit convoluted to do this right now as you need to get access to the SSLSocket that is part of the connection which isn't exposed through the API so you need to use reflection to get access to the Socket. But the following is an example that should work:
ActiveMQConnection connection = (ActiveMQConnection) activeMQSslConnectionFactory.createConnection(); TcpTransport tcpTransport = connection.getTransport().narrow(TcpTransport.class); Field socketField = TcpTransport.class.getDeclaredField("socket"); socketField.setAccessible(true); Socket socket = (Socket) socketField.get(tcpTransport); if (socket instanceof SSLSocket) { SSLSocket sslSocket = (SSLSocket)socket; System.out.println("SSL/TLS Protocol: " + sslSocket.getSession().getProtocol()); System.out.println("Cipher Suite: " + sslSocket.getSession().getCipherSuite()); } On Sun, Dec 18, 2016 at 7:41 PM, rmkreddy <rmkre...@gmail.com> wrote: > Hello, > > I would like to retrieve the SSL/TLS protocol used and the cipher suite used > when a secure AciveMQConnection is established. I do not find any > appropriate api to find the same. Here is the sample code which I am using > to connect to ActiveMQ. > > ActiveMQSslConnectionFactory sslConnectionFactory = new > ActiveMQSslConnectionFactory("ssl://ActiveqMQIP:61617"); > sslConnectionFactory.setKeyStore(new > File("C:\\users\\user\\desktop\\client.ks").toURI().toString()); > sslConnectionFactory.setTrustStore(new > File("C:\\users\\user\\desktop\\client.ts").toURI().toString()); > sslConnectionFactory.setKeyStorePassword("test"); > sslConnectionFactory.setTrustStorePassword("test"); > connection = sslConnectionFactory.createConnection(); > > > I am able to connect to activemq successfully, create sessions/topics/queues > and do all the needed operations. But I do not find any way to retrieve the > protocol used(TLS or TLSv1.1 or TLSv1.2) and the ciphersuite used. Is there > any way/api to find the same? > > Regards, > Mahesh > > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/How-to-retrieve-the-SSL-protocol-and-cipher-suites-usedin-ActiveMQCOnnection-tp4720573.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com.