You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/04/09 02:47:21 UTC

[incubator-servicecomb-java-chassis] 03/04: [SCB-459]Update netty's version to 4.1.19 and vertx's version to 3.5.1

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit a1a9567f6689efd73f72849ab48dc38dfa5916e2
Author: xuyiyun0929 <ev...@icloud.com>
AuthorDate: Sun Apr 8 19:55:00 2018 +0800

    [SCB-459]Update netty's version to 4.1.19 and vertx's version to 3.5.1
---
 .../servicecomb/foundation/vertx/VertxTLSBuilder.java    |  8 ++++----
 .../foundation/vertx/TestVertxTLSBuilder.java            | 16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
index a7a351a..a253696 100644
--- a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
+++ b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
@@ -18,6 +18,8 @@
 package org.apache.servicecomb.foundation.vertx;
 
 import java.io.File;
+import java.util.Arrays;
+import java.util.HashSet;
 
 import org.apache.servicecomb.foundation.ssl.SSLCustom;
 import org.apache.servicecomb.foundation.ssl.SSLManager;
@@ -126,10 +128,8 @@ public final class VertxTLSBuilder {
         throw new IllegalArgumentException("invalid trust store type.");
       }
     }
-
-    for (String protocol : sslOption.getProtocols().split(",")) {
-      tcpClientOptions.addEnabledSecureTransportProtocol(protocol);
-    }
+    HashSet<String> protocols = new HashSet<>(Arrays.asList(sslOption.getProtocols().split(",")));
+    tcpClientOptions.setEnabledSecureTransportProtocols(protocols);
     for (String cipher : SSLManager.getEnalbedCiphers(sslOption.getCiphers())) {
       tcpClientOptions.addEnabledCipherSuite(cipher);
     }
diff --git a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestVertxTLSBuilder.java b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestVertxTLSBuilder.java
index f4acc8a..33ef445 100644
--- a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestVertxTLSBuilder.java
+++ b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestVertxTLSBuilder.java
@@ -49,7 +49,7 @@ public class TestVertxTLSBuilder {
     SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass());
     HttpServerOptions serverOptions = new HttpServerOptions();
     VertxTLSBuilder.buildNetServerOptions(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.getClientAuth(), ClientAuth.REQUEST);
   }
 
@@ -90,7 +90,7 @@ public class TestVertxTLSBuilder {
     SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass());
     HttpClientOptions serverOptions = new HttpClientOptions();
     VertxTLSBuilder.buildHttpClientOptions(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -100,7 +100,7 @@ public class TestVertxTLSBuilder {
     SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass());
     HttpClientOptions serverOptions = new HttpClientOptions();
     VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -113,7 +113,7 @@ public class TestVertxTLSBuilder {
     SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass());
     HttpClientOptions serverOptions = new HttpClientOptions();
     VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -130,7 +130,7 @@ public class TestVertxTLSBuilder {
       }
     };
     VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -147,7 +147,7 @@ public class TestVertxTLSBuilder {
       }
     };
     VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -164,7 +164,7 @@ public class TestVertxTLSBuilder {
       }
     };
     VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.isTrustAll(), true);
   }
 
@@ -182,7 +182,7 @@ public class TestVertxTLSBuilder {
       }
     };
     VertxTLSBuilder.buildNetServerOptions(option, custom, serverOptions);
-    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 3);
+    Assert.assertEquals(serverOptions.getEnabledSecureTransportProtocols().toArray().length, 1);
     Assert.assertEquals(serverOptions.getClientAuth(), ClientAuth.REQUEST);
   }
 }

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.