cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1303768 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
Date Thu, 22 Mar 2012 13:08:13 GMT
Author: sergeyb
Date: Thu Mar 22 13:08:13 2012
New Revision: 1303768

URL: http://svn.apache.org/viewvc?rev=1303768&view=rev
Log:
Updating HTTPTransportActivator to set the TLS properties only if the address starts from
'https'

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java?rev=1303768&r1=1303767&r2=1303768&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
Thu Mar 22 13:08:13 2012
@@ -85,7 +85,7 @@ import org.osgi.util.tracker.ServiceTrac
 public class HTTPTransportActivator 
     implements BundleActivator, ManagedServiceFactory, HTTPConduitConfigurer {
     public static final String FACTORY_PID = "org.apache.cxf.http.conduits"; 
-    
+    private static final String SECURE_HTTP_PREFIX = "https";
     
     private static class PidInfo implements Comparable<PidInfo> {
         final Dictionary<String, String> props;
@@ -235,25 +235,27 @@ public class HTTPTransportActivator 
                 synchronized (m) {
                     m.reset(address);
                     if (m.matches()) {
-                        apply(info.getProps(), c);
+                        apply(info.getProps(), c, address);
                     }
                 }
             }
         }
         
         if (byAddress != null) {
-            apply(byAddress.getProps(), c);
+            apply(byAddress.getProps(), c, address);
         }
         if (byName != null) {
-            apply(byName.getProps(), c);
+            apply(byName.getProps(), c, address);
         }
     }
 
-    private void apply(Dictionary<String, String> d, HTTPConduit c) {
+    private void apply(Dictionary<String, String> d, HTTPConduit c, String address)
{
         applyClientPolicies(d, c);
         applyAuthorization(d, c);
         applyProxyAuthorization(d, c);
-        applyTlsClientParameters(d, c);
+        if (address != null && address.startsWith(SECURE_HTTP_PREFIX)) {
+            applyTlsClientParameters(d, c);
+        }
     }
 
     private void applyTlsClientParameters(Dictionary<String, String> d, HTTPConduit
c) {



Mime
View raw message