You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by salemi <sa...@avaya.com> on 2015/01/08 18:22:14 UTC

http client - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Hi All,

I am getting the following exception when I use https4 as followed below:

<to
uri="{{https.url}}?authUsername=admin&amp;authPassword=Admin01$&amp;authMethod=Basic&amp;x509HostnameVerifier=allowAllHostnameVerifier"/>
        

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
        at com.ibm.jsse2.j.a(j.java:24)
        at com.ibm.jsse2.j.a(j.java:19)
        at com.ibm.jsse2.qc.b(qc.java:660)
        at com.ibm.jsse2.qc.a(qc.java:613)
        at com.ibm.jsse2.qc.h(qc.java:266)
        at com.ibm.jsse2.qc.a(qc.java:214)
        at com.ibm.jsse2.h.write(h.java:10)

What am I doing wrong here?

Thanks,
Ali




-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/http-client-javax-net-ssl-SSLHandshakeException-Received-fatal-alert-handshake-failure-tp5761469.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: http client - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Posted by salemi <sa...@avaya.com>.
Thank you for your respond.

Below is how it can be done.

public MyHttpClientConfigurer implements HttpClientConfigurer{

void configureHttpClient(org.apache.http.impl.client.HttpClientBuilder
clientBuilder){
  SSLContext sslContext = SSLUtilityFactory.createSSLContext(); 
  clientBuilder.setSSLContext(sslContext);
}


<bean id="myHttpClientConfigurer" class="MyHttpClientConfigurer"/>

 
<to
uri="https4://myhostname.com:443/myURL?httpClientConfigurer=myHttpClientConfigurer"/>



-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/http-client-javax-net-ssl-SSLHandshakeException-Received-fatal-alert-handshake-failure-tp5761469p5761706.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: http client - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Posted by Willem Jiang <wi...@gmail.com>.
You can setup the sslContext by implementing a HttpClientConfigurer[1].

[1]https://camel.apache.org/http4#HTTP4-ConfiguringApacheHTTPClientDirectly

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2015 at 2:53:00 PM, salemi (salemi@avaya.com) wrote:
> Hi,
> Thanks for your respond. My problem is that I am running in a container and
> there is api that return the sslcontext to me and I have to use the provided
> sslcontext. See the code below.
>  
> SSLContext sslContext = SSLUtilityFactory.createSSLContext();
>  
> How can I tell https4 to use the sslcontext provided?
>  
> Thanks,
> Ali
>  
>  
>  
>  
> -----
> Alireza Salemi
> --
> View this message in context: http://camel.465427.n5.nabble.com/http-client-javax-net-ssl-SSLHandshakeException-Received-fatal-alert-handshake-failure-tp5761469p5761538.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  


Re: http client - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Posted by salemi <sa...@avaya.com>.
Hi, 
Thanks for your respond. My problem is that I am running in a container and
there is api that return the sslcontext to me and I have to use the provided
sslcontext. See the code below.

SSLContext sslContext = SSLUtilityFactory.createSSLContext();

How can I tell https4 to use the sslcontext provided?

Thanks,
Ali




-----
Alireza Salemi
--
View this message in context: http://camel.465427.n5.nabble.com/http-client-javax-net-ssl-SSLHandshakeException-Received-fatal-alert-handshake-failure-tp5761469p5761538.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: http client - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You may need to enable the SSL Socket debug[1] to see why the handshake failed.

[1]http://www.herongyang.com/JDK/SSL-Socket-Communication-Debug-javax-net-debug.html
--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 9, 2015 at 1:42:43 AM, salemi (salemi@avaya.com) wrote:
> Hi All,
>  
> I am getting the following exception when I use https4 as followed below:
>  
> > uri="{{https.url}}?authUsername=admin&authPassword=Admin01$&authMethod=Basic&x509HostnameVerifier=allowAllHostnameVerifier"/>  
>  
>  
> javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure  
> at com.ibm.jsse2.j.a(j.java:24)
> at com.ibm.jsse2.j.a(j.java:19)
> at com.ibm.jsse2.qc.b(qc.java:660)
> at com.ibm.jsse2.qc.a(qc.java:613)
> at com.ibm.jsse2.qc.h(qc.java:266)
> at com.ibm.jsse2.qc.a(qc.java:214)
> at com.ibm.jsse2.h.write(h.java:10)
>  
> What am I doing wrong here?
>  
> Thanks,
> Ali
>  
>  
>  
>  
> -----
> Alireza Salemi
> --
> View this message in context: http://camel.465427.n5.nabble.com/http-client-javax-net-ssl-SSLHandshakeException-Received-fatal-alert-handshake-failure-tp5761469.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>