activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1214772 - in /activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp: SslTransportFactory.java SslTransportServer.java
Date Thu, 15 Dec 2011 14:24:12 GMT
Author: chirino
Date: Thu Dec 15 14:24:12 2011
New Revision: 1214772

URL: http://svn.apache.org/viewvc?rev=1214772&view=rev
Log:
Fixes APLO-112 : Add support for TLS 1.2

You can now bind="tlsv1.2://0.0.0.0:61614" in the connector configuration.

Modified:
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportServer.java

Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java?rev=1214772&r1=1214771&r2=1214772&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
Thu Dec 15 14:24:12 2011
@@ -65,16 +65,12 @@ public class SslTransportFactory extends
     protected String protocol(String scheme) {
         if( scheme.equals("tls") ) {
             return "TLS";
-        } else if( scheme.equals("tlsv1") ) {
-            return "TLSv1";
-        } else if( scheme.equals("tlsv1.1") ) {
-            return "TLSv1.1";
+        } else if( scheme.startsWith("tlsv") ) {
+            return "TLSv"+scheme.substring(4);
         } else if( scheme.equals("ssl") ) {
             return "SSL";
-        } else if( scheme.equals("sslv2") ) {
-            return "SSLv2";
-        } else if( scheme.equals("sslv3") ) {
-            return "SSLv3";
+        } else if( scheme.startsWith("sslv") ) {
+            return "SSLv"+scheme.substring(4);
         }
         return null;
     }

Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportServer.java?rev=1214772&r1=1214771&r2=1214772&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportServer.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportServer.java
Thu Dec 15 14:24:12 2011
@@ -23,6 +23,7 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 import java.net.URI;
 import java.net.UnknownHostException;
+import java.security.NoSuchAlgorithmException;
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -48,7 +49,6 @@ public class SslTransportServer extends 
 
     public void start(Runnable onCompleted) throws Exception {
         if( keyManagers!=null ) {
-            sslContext = SSLContext.getInstance(protocol);
             sslContext.init(keyManagers, trustManagers, null);
         } else {
             sslContext = SSLContext.getDefault();
@@ -62,8 +62,9 @@ public class SslTransportServer extends 
         return rc;
     }
 
-    protected SslTransportServer protocol(String value) {
+    protected SslTransportServer protocol(String value) throws NoSuchAlgorithmException {
         this.protocol = value;
+        sslContext = SSLContext.getInstance(protocol);
         return this;
     }
 



Mime
View raw message