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/06/05 07:01:17 UTC

[incubator-servicecomb-java-chassis] branch master updated: [SCB-350] if the file not exist, make a warn log to trace it. make the error more clearly

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


The following commit(s) were added to refs/heads/master by this push:
     new 32e452f  [SCB-350] if the file not exist, make a warn log to trace it. make the error more clearly
32e452f is described below

commit 32e452f8f0bce1241228a9402b440abe54a307d3
Author: weixing <je...@163.com>
AuthorDate: Tue Jun 5 09:07:43 2018 +0800

    [SCB-350] if the file not exist, make a warn log to trace it. make the error more clearly
---
 .../servicecomb/foundation/vertx/VertxTLSBuilder.java     | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 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 9b7fd28..bd6642b 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
@@ -23,6 +23,8 @@ import org.apache.servicecomb.foundation.ssl.SSLCustom;
 import org.apache.servicecomb.foundation.ssl.SSLManager;
 import org.apache.servicecomb.foundation.ssl.SSLOption;
 import org.apache.servicecomb.foundation.ssl.SSLOptionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import io.vertx.core.http.ClientAuth;
 import io.vertx.core.http.HttpClientOptions;
@@ -34,6 +36,8 @@ import io.vertx.core.net.PfxOptions;
 import io.vertx.core.net.TCPSSLOptions;
 
 public final class VertxTLSBuilder {
+  private static final Logger LOGGER = LoggerFactory.getLogger(VertxTLSBuilder.class);
+
   private static final String STORE_PKCS12 = "PKCS12";
 
   private static final String STORE_JKS = "JKS";
@@ -93,7 +97,8 @@ public final class VertxTLSBuilder {
       options.setSessionCacheEnabled(true);
       tcpClientOptions.setOpenSslEngineOptions(new OpenSSLEngineOptions());
     }
-    if (isFileExists(sslCustom.getFullPath(sslOption.getKeyStore()))) {
+    String fullKeyStore = sslCustom.getFullPath(sslOption.getKeyStore());
+    if (isFileExists(fullKeyStore)) {
       if (STORE_PKCS12.equalsIgnoreCase(sslOption.getKeyStoreType())) {
         PfxOptions keyPfxOptions = new PfxOptions();
         keyPfxOptions.setPath(sslCustom.getFullPath(sslOption.getKeyStore()));
@@ -107,9 +112,11 @@ public final class VertxTLSBuilder {
       } else {
         throw new IllegalArgumentException("invalid key store type.");
       }
+    } else {
+      LOGGER.warn("keyStore [" + fullKeyStore + "] file not exist, please check!");
     }
-
-    if (isFileExists(sslCustom.getFullPath(sslOption.getTrustStore()))) {
+    String fullTrustStore = sslCustom.getFullPath(sslOption.getTrustStore());
+    if (isFileExists(fullTrustStore)) {
       if (STORE_PKCS12.equalsIgnoreCase(sslOption.getTrustStoreType())) {
         PfxOptions trustPfxOptions = new PfxOptions();
         trustPfxOptions.setPath(sslCustom.getFullPath(sslOption.getTrustStore()));
@@ -125,6 +132,8 @@ public final class VertxTLSBuilder {
       } else {
         throw new IllegalArgumentException("invalid trust store type.");
       }
+    } else {
+      LOGGER.warn("trustStore [" + fullTrustStore + "] file not exist, please check!");
     }
     for (String protocol : sslOption.getProtocols().split(",")) {
       tcpClientOptions.addEnabledSecureTransportProtocol(protocol);

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