SSL Connection error - IOException: unsupported keyword OID.2.5.4.17
Hi,
Hopefully someone can help me. I have seen a couple of very similar problems posted to this forum although none of them have had much response - so if anyone can help then I would be very grateful if you could reply as soon as possible.
I am trying to get my Java application (running on Dynamo 5.1.1p3, jdk 1.3.1_02-b02) to connect and exchange data (send and receive) between a servlet running on an https within our firewall.
I get an error - java.io.IOException: unsupported keyword OID.2.5.4.17 - on my console when I try the line:
OutputStream out = connection.getOutputStream();
My code gives the same error when I try and run it in a 'main' method in a class on the command line, so it is not Dynamo specific. I have paste the code below and I do not think that there is a problem with it. Apparently, other developers in my company working on a WebSphere platform with the same code do not have see a problem (WebSphere has its own version of the jsse.jar file - ibmjsse.jar).
The servlet is also written in J2EE for WebSphere and therefore I am not sure if it is that code which does not like the jsse file or it is a https server configuration issue. Has anyone experienced this before? And if so, what was the resolution.
Thanks in advance for any help that you can give.
Ben
The code I have tried is below:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
String requestXML = "...the String I am sending....";
//String that represents the https url
String urlString = "https://internaltest.etc.etc/etc/VisitorDataAccessServlet";
URL url = new URL(urlString);
//Opening a http connection
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true); //This is required for posting data to the servlet
connection.setRequestMethod("POST");
//Getting the output stream and writing the request XML string to it
try
{
OutputStream out = connection.getOutputStream();
//The parameter name that the wrapper expects in requestXML
String request = "requestXML=" + requestXML;
out.write(request.getBytes());
//Getting the input stream and reading the response XML string from it.
InputStream in = connection.getInputStream();
int c;
StringBuffer responseBuffer = new StringBuffer();
while ((c = in.read()) != -1) {
responseBuffer.append((char) c);
}
String responseXML = responseBuffer.toString(); //The response XML
System.out.println("response = " + responseXML);
}
catch (Exception e)
{
System.out.println ("Exception occurred - " + e);
}

