mirror of https://github.com/apache/activemq.git
Fixes AMQ-4672 - [JMS Client] Set the SNI field on SSL connections
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1511335 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ccde93a238
commit
dd286e2381
|
@ -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 TcpTransport {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue