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);

}

[2862 byte] By [bentriska] at [2007-9-28 5:51:33]
# 1

Hi Ben.

I had this same problem some time ago, and filed a bug with Sun. I can't find the bug any more, but was told that this problem has been fixed in the JSSE that is included with java1.4.x.

I was told that it would NOT be fixed in JSSE1.0.x, but I do see that there is a JSSE1.0.3_01, so the best I can offer is:

Try JSSE1.0.3_01 if you haven't already and switch to java1.4.x when that doesn't work, or get yourself a cert that doesn't have a postal code in it.

Cheers,

Zac.

UncleSpuda at 2007-7-9 17:02:26 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2
I' using JSSE1.0.3_02 but facing same problem with jdk1.2.2. Does anyone has any clue what could be the potential reason for this problem? Any suggestions would be highly appreciated.Please reply in rajiv.soni@us.WESCOglobal.comThanks & RegardsRajiv
srajiv1975a at 2007-7-9 17:02:26 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...