Using Jersey Client on port 443
I want to configure jersey client to use port 443 when connecting to a web resource. I attempted to hard code the port in the resource locator but the client resorts back to port 80. I think this works automatically when using the HTTPUrlConnection but with HttpClient it appears you have to manually configure it.
Can soemone suggest how i might do this?
FYI - I have already tried this with httpClient Credential provider
httpClient.getCredentialsProvider().setCredentials(new AuthScope(null, 443,null, "https"), creds);
And also
Scheme schemeHttps = new Scheme("https", SSLSocketFactory
.getSocketFac开发者_如何学JAVAtory(), 443);
client.getConnectionManager().getSchemeRegistry().register(schemeHttps);
Thanks.
This turned out to be an issue with the proxy settings set in my Eclipse IDE. The IIS server could not recognize the "localhost" address so when i changed it to 127.0.0.1 it worked..
精彩评论