You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by as...@apache.org on 2014/07/23 14:11:40 UTC

git commit: [CXF-5652]: refactored system properties in own method

Repository: cxf
Updated Branches:
  refs/heads/master 9e663d12d -> 6127950d2


[CXF-5652]: refactored system properties in own method


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6127950d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6127950d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6127950d

Branch: refs/heads/master
Commit: 6127950d2d60308c582387d2f2c1717c824eecc4
Parents: 9e663d1
Author: Andrei Shakirin <an...@gmail.com>
Authored: Wed Jul 23 14:11:07 2014 +0200
Committer: Andrei Shakirin <an...@gmail.com>
Committed: Wed Jul 23 14:11:07 2014 +0200

----------------------------------------------------------------------
 .../apache/cxf/configuration/jsse/SSLUtils.java   | 18 ++++++++++++++----
 .../https/HttpsURLConnectionFactory.java          |  5 ++---
 2 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6127950d/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
index 0663469..0906818 100644
--- a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
+++ b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
@@ -436,10 +436,9 @@ public final class SSLUtils {
             return cipherSuites;
         }
         if (!exclude) {
-            String jvmCipherSuites = System.getProperty(HTTPS_CIPHER_SUITES);
-            if (jvmCipherSuites != null) {
-                LogUtils.log(log, Level.FINE, "CIPHERSUITES_SYSTEM_PROPERTY_SET", jvmCipherSuites);
-                return jvmCipherSuites.split(",");
+            cipherSuites = getSystemCiphersuites(log);
+            if (cipherSuites != null) {
+                return cipherSuites;
             }
         }
         LogUtils.log(log, Level.FINE, "CIPHERSUITES_NOT_SET");
@@ -487,6 +486,17 @@ public final class SSLUtils {
         }
         return cipherSuites;
     }
+
+    private static String[] getSystemCiphersuites(Logger log) {
+        String jvmCipherSuites = System.getProperty(HTTPS_CIPHER_SUITES);
+        if ((jvmCipherSuites != null) && (!jvmCipherSuites.isEmpty())) {
+            LogUtils.log(log, Level.FINE, "CIPHERSUITES_SYSTEM_PROPERTY_SET", jvmCipherSuites);
+            return jvmCipherSuites.split(",");
+        } else {
+            return null;
+        }
+        
+    }
     
     private static List<Pattern> compileRegexPatterns(List<String> regexes,
                                                       boolean include,

http://git-wip-us.apache.org/repos/asf/cxf/blob/6127950d/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
index 5b0f025..f95c5a7 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
@@ -163,11 +163,10 @@ public class HttpsURLConnectionFactory {
             KeyManager[] keyManagers = tlsClientParameters.getKeyManagers();
             if (tlsClientParameters.getCertAlias() != null) {
                 getKeyManagersWithCertAlias(tlsClientParameters, keyManagers);
-            }
-            
+            }            
             if (keyManagers == null) {
                 keyManagers = SSLUtils.getDefaultKeyStoreManagers(LOG);
-            }
+            }            
             ctx.init(keyManagers, tlsClientParameters.getTrustManagers(),
                      tlsClientParameters.getSecureRandom());