Quantcast

WebClient request to HTTPS URL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

WebClient request to HTTPS URL

cganesan
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebClient request to HTTPS URL

Sergey Beryozkin
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: WebClient request to HTTPS URL

Andrei Shakirin
In reply to this post by cganesan
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:[hidden email]]
Sent: 27 June 2012 19:50
To: [hidden email]
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
Loading...