users@jersey.java.net

[Jersey] Unable to work on Jersey Client with https

From: indhums2011 <manzams_at_gmail.com>
Date: Tue, 15 Nov 2011 03:53:06 -0800 (PST)

Hi,

I am completely new to REST technology. I have to create a REST client which
interacts with a secure server by sending and receving request and
responses. The goal of this application is to send request and get response
as xml/json. I am using Jersey client for creating client. It works
successfully when I used http://.....
When https://... is used Client Handler Exceptionwhen the following
statement executed .

Exception :com.sun.jersey.api.client.ClientHandlerException:
javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:128)
at com.sun.jersey.api.client.Client.handle(Client.java:569)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:556)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:69)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:451)
at com.vanilla.sample.RestService.login(CareGiver.java:151)
at com.vanilla.sample.RestService.main(CareGiver.java:52)
Caused by: javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1774)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:954)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:215)
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:126)
... 6 more


Can anyone help me....

Thanks in advance

--
View this message in context: http://jersey.576304.n2.nabble.com/Unable-to-work-on-Jersey-Client-with-https-tp6996013p6996013.html
Sent from the Jersey mailing list archive at Nabble.com.