You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marcel Stör <ma...@frightanic.com> on 2010/04/12 18:20:12 UTC
Using custom SSLSocketFactory
Java allows to use a custome VM-wide SSLSocketFactory implementation
like so:
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)
I noticed, however, that CXF does not honor this "setting" and overrides
the SSLSocketFactory to be used in
org.apache.cxf.transport.https.HttpsURLConnectionFactory.decorateWithTLS(HttpURLConnection).
Question: how can I use my (customer's) own configuration of a
SSLSocketFactory with CXF?
Regards,
Marcel
--
Marcel Stör, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
Skype: marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Using custom SSLSocketFactory
Posted by Marcel Stör <ma...@frightanic.com>.
On 13.04.2010, at 11:12, Cyrille Le Clerc wrote:
> Hello Marcel,
>
> We introduced in CXF 2.2.7 "CXF-2693 : Allow to use
> HttpsURLConnection's defaultSSLSocketFactory and
> defaultHostnameVerifier in CXF client". This adds the attributes
> "useHttpsURLConnectionDefaultSslSocketFactory" and
> "useHttpsURLConnectionDefaultHostnameVerifier" to the
> <http-conf:tlsClientParameters ... /> configuration element (2).
>
> I understand this is slightly different from what you ask for this
> may be a convenient workaround. Would it do the job ?
It's *exactly* what I was looking for. Thanks a lot!
Regards,
Marcel
--
Marcel Stör, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
Skype: marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Using custom SSLSocketFactory
Posted by Cyrille Le Clerc <cl...@apache.org>.
Hello Marcel,
We introduced in CXF 2.2.7 "CXF-2693 : Allow to use
HttpsURLConnection's defaultSSLSocketFactory and
defaultHostnameVerifier in CXF client". This adds the attributes
"useHttpsURLConnectionDefaultSslSocketFactory" and
"useHttpsURLConnectionDefaultHostnameVerifier" to the
<http-conf:tlsClientParameters ... /> configuration element (2).
I understand this is slightly different from what you ask for this
may be a convenient workaround. Would it do the job ?
Cyrille
--
Cyrille Le Clerc
cleclerc@xebia.fr
(1) https://issues.apache.org/jira/browse/CXF-2693
(2) http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-The%7B%7BtlsClientParameters%7D%7Delement
On Mon, Apr 12, 2010 at 9:37 PM, Marcel Stör <ma...@frightanic.com> wrote:
>
> On 12.04.2010, at 18:20, Marcel Stör wrote:
>
> > Java allows to use a custom VM-wide SSLSocketFactory implementation like so:
> >
> > javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)
> >
> > I noticed, however, that CXF does not honor this "setting" and overrides the SSLSocketFactory to be used in org.apache.cxf.transport.https.HttpsURLConnectionFactory.decorateWithTLS(HttpURLConnection).
> >
> > Question: how can I use my (customer's) own configuration of a SSLSocketFactory with CXF?
>
>
>
> Not quite sure if it's relevant for the problem stated above...We're creating the CXF proxy factory beans in Spring like this:
>
> <bean id="taxV11" factory-bean="taxV11Factory" factory-method="create" />
>
> <!-- Tax -->
> <!-- version 1.1 -->
> <bean id="taxV11Factory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
> <property name="serviceClass" value="my-service-class" />
> <property name="address" value="${kernel.endpointUri}/tax/1" />
> </bean>
>
> This means that there's no Java code that directly interoperates with CXF in our application.
>
> Regards,
> Marcel
>
> --
> Marcel Stör, http://www.frightanic.com
> Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
> Skype: marcelstoer
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>
Re: Using custom SSLSocketFactory
Posted by Marcel Stör <ma...@frightanic.com>.
On 12.04.2010, at 18:20, Marcel Stör wrote:
> Java allows to use a custom VM-wide SSLSocketFactory implementation like so:
>
> javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)
>
> I noticed, however, that CXF does not honor this "setting" and overrides the SSLSocketFactory to be used in org.apache.cxf.transport.https.HttpsURLConnectionFactory.decorateWithTLS(HttpURLConnection).
>
> Question: how can I use my (customer's) own configuration of a SSLSocketFactory with CXF?
Not quite sure if it's relevant for the problem stated above...We're creating the CXF proxy factory beans in Spring like this:
<bean id="taxV11" factory-bean="taxV11Factory" factory-method="create" />
<!-- Tax -->
<!-- version 1.1 -->
<bean id="taxV11Factory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="my-service-class" />
<property name="address" value="${kernel.endpointUri}/tax/1" />
</bean>
This means that there's no Java code that directly interoperates with CXF in our application.
Regards,
Marcel
--
Marcel Stör, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
Skype: marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org