Hopefully this is a less useless question than my last one.
I have two projects using GetMethod. Both are connecting to the same https:
website. One, however, is returning the following:
java.net.SocketException: Unconnected sockets not implemented
at javax.net.SocketFactory.createSocket(SocketFactory.java:2)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:116)
Searching around, this appears related to SSL, but that's all I've got.
Both projects are the same, as near as I can tell. Both have a matching
copy of a Java Keystore that I created to accept the self signed cert on the
site. Both set the truststore to be that Keystore:
System.setProperty("javax.net.ssl.trustStore", "test/jssecacerts");
The code being called is as follows:
public final String httpGet(String urlString, int timeout) {
HttpClient client = buildHttpClient(timeout);
GetMethod method = new GetMethod(urlString);
try {
int statusCode = client.executeMethod(method);
if (statusCode != -1) {
String result =
method.getResponseBodyAsString();
method.releaseConnection();
return result;
}
} catch (IOException ioe) {
logger.error("Error executing HTTP GET", ioe);
}
return null;
}
private HttpClient buildHttpClient(int timeout) {
HttpClient client = new HttpClient();
HttpConnectionManager manager =
client.getHttpConnectionManager();
HttpConnectionParams params = manager.getParams();
params.setConnectionTimeout(timeout);
return client;
}
Any ideas where I've gone wrong?
--
View this message in context:
http://www.nabble.com/Unconnected-sockets-not-implemented-tp19107059p19107059.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]