You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Ganesan, Chandru" <ch...@hp.com> on 2012/06/27 19:50:04 UTC

WebClient request to HTTPS URL

Hi

I could successfully use WebClient to make plain HTTP requests to the server. Now I'd like to change the request URL to HTTPS. Is there any special handling needed for this in the client code.

I'm getting following error when accessing an HTTPS URL:

[No Trust Decider for Conduit '{https://<suppressing the url in email>:443} WebClient.http-conduit'. An afirmative Trust Decision is assumed.]
[Interceptor for {https:// ://<suppressing the url in email>:443}WebClient has thrown exception, unwinding now]
org.apache.cxf.interceptor.Fault: Could not send Message.
                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
                at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:595)
                at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:576)
                at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:323)
                at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:390)

Appreciate the help

Thanks
Chandru

Re: WebClient request to HTTPS URL

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 27/06/12 18:50, Ganesan, Chandru wrote:
> Hi
>
> I could successfully use WebClient to make plain HTTP requests to the server. Now I'd like to change the request URL to HTTPS. Is there any special handling needed for this in the client code.
>
> I'm getting following error when accessing an HTTPS URL:
>
> [No Trust Decider for Conduit '{https://<suppressing the url in email>:443} WebClient.http-conduit'. An afirmative Trust Decision is assumed.]
> [Interceptor for {https:// ://<suppressing the url in email>:443}WebClient has thrown exception, unwinding now]
> org.apache.cxf.interceptor.Fault: Could not send Message.
>                  at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
>                  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
>                  at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:595)
>                  at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:576)
>                  at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:323)
>                  at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:390)
>
> Appreciate the help

Please see
http://cxf.apache.org/docs/secure-jax-rs-services.html#SecureJAX-RSServices-Configuringclients
http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-ConfiguringanHTTPConduitfromSpring

You can also experiment with setting the conduit from the code, example,
HTTPConduit conduit = WebClient.getConfig(client).getHTTPConduit();
// set TLS properties

This blog from Arul shows the example:
http://aruld.info/programming-ssl-for-jetty-based-cxf-services/

Sergey

>
> Thanks
> Chandru
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

RE: WebClient request to HTTPS URL

Posted by Andrei Shakirin <as...@talend.com>.
Hi Chandru,

I think you should configure TLSClient parameters (TrustStore, TrustManager) in HTTPConduit.
You can refer wsdl_first_https sample for details.

Regards,
Andrei.

-----Original Message-----
From: Ganesan, Chandru [mailto:chandru.ganesan@hp.com] 
Sent: 27 June 2012 19:50
To: users@cxf.apache.org
Subject: WebClient request to HTTPS URL 

Hi

I could successfully use WebClient to make plain HTTP requests to the server. Now I'd like to change the request URL to HTTPS. Is there any special handling needed for this in the client code.

I'm getting following error when accessing an HTTPS URL:

[No Trust Decider for Conduit '{https://<suppressing the url in email>:443} WebClient.http-conduit'. An afirmative Trust Decision is assumed.] [Interceptor for {https:// ://<suppressing the url in email>:443}WebClient has thrown exception, unwinding now]
org.apache.cxf.interceptor.Fault: Could not send Message.
                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
                at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:595)
                at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:576)
                at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:323)
                at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:390)

Appreciate the help

Thanks
Chandru