users@jersey.java.net

[Jersey] Client - Server SSL communication, 400 Bad Request

From: Jean-Louis FERRER <ferrer.jeanlouis_at_gmail.com>
Date: Tue, 13 Mar 2012 11:15:07 +0100

Hey,

The situation is as follows:

I wish to create a Client that connects to a server (using SSL), and send
some request (mainly GET ones). The server part isn't mine, I cannot have
access to it other than through requests.

Whatever request I send to the server (and I am sure these requests do
work, because I can run them on Chrome, Firefox, IE and get the right
result as XML/plain text), I get a 400 Bad Request error as follows:

GET https://server/.../service returned a response status of 400 Bad Request
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
        at
com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at
com.sun.jersey.api.client.WebResource$Builder.method(WebResource.java:621)
 at
package.Localhost$ManagerManagerIdService.getAsApplicationXml(Localhost.java:2146)
at package.Test.main(Test.java:29)

Now I wonder, since I know that the request is working, I guess it could
come from the SSL implementation I have found and adapted (tried various
ones, found on the internet or here). Shouldn't it be sending a 403
Forbidden error in case of authentification problem ? If it is not an
authentification problem, then I'm just clueless as to where does this
problem come from ...

The Localhost.java file (and some others) were generated using the
wadl2java tool.

Let me know if you want to have a look at the implementation of the Client.

Cheers,
JL