You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/08/07 16:42:31 UTC
svn commit: r1511335 -
/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
Author: chirino
Date: Wed Aug 7 14:42:31 2013
New Revision: 1511335
URL: http://svn.apache.org/r1511335
Log:
Fixes AMQ-4672 - [JMS Client] Set the SNI field on SSL connections
Modified:
activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java?rev=1511335&r1=1511334&r2=1511335&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java (original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java Wed Aug 7 14:42:31 2013
@@ -21,6 +21,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.UnknownHostException;
import java.security.cert.X509Certificate;
+import java.util.HashMap;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
@@ -29,6 +30,7 @@ import javax.net.ssl.SSLSocketFactory;
import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.wireformat.WireFormat;
/**
@@ -59,6 +61,15 @@ public class SslTransport extends TcpTra
super(wireFormat, socketFactory, remoteLocation, localLocation);
if (this.socket != null) {
((SSLSocket)this.socket).setNeedClientAuth(needClientAuth);
+
+ // Lets try to configure the SSL SNI field. Handy in case your using
+ // a single proxy to route to different messaging apps.
+
+ // On java 1.7 it seems like it can only be configured via reflection.
+ // todo: find out if this will work on java 1.8
+ HashMap props = new HashMap();
+ props.put("host", remoteLocation.getHost());
+ IntrospectionSupport.setProperties(this.socket, props);
}
}