Author: alessio.soldano(a)jboss.com
Date: 2010-05-05 05:35:29 -0400 (Wed, 05 May 2010)
New Revision: 12163
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
Log:
[JBWS-3017] Set default HTTPConduit
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-05-05
06:35:09 UTC (rev 12162)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-05-05
09:35:29 UTC (rev 12163)
@@ -22,11 +22,13 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.databinding.DataBinding;
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxb.JAXBDataBinding;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.transport.http.HTTPConduit;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
@@ -62,6 +64,10 @@
{
configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
}
+ else if (beanInstance instanceof HTTPConduit)
+ {
+ configureHTTPConduit((HTTPConduit)beanInstance);
+ }
//add other beans configuration here below
}
@@ -125,6 +131,27 @@
//add other configurations here below
}
+ /**
+ * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS
client parameters according
+ * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
+ *
+ * @param conduit
+ */
+ protected synchronized void configureHTTPConduit(HTTPConduit conduit)
+ {
+ TLSClientParameters parameters = conduit.getTlsClientParameters();
+ if (parameters == null) //don't do anything when user already provided a
configuration
+ {
+ parameters = new TLSClientParameters();
+ parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
+ if (Boolean.getBoolean("org.jboss.security.ignoreHttpsHost"))
+ {
+ parameters.setDisableCNCheck(true);
+ }
+ conduit.setTlsClientParameters(parameters);
+ }
+ }
+
@SuppressWarnings("unchecked")
protected static void setBindingCustomization(DataBinding db, BindingCustomization
customization)
{