Skip to Content
0
Former Member
Nov 28, 2009 at 06:53 AM

Bad Record MAC. exception while using urlConnection.getInputStream()

52 Views

All,

In my SAP J2EE instance, from filter I am trying to do get data from an url (protocol is https).

For this I am using urlInstance.openConnection() after that urlConnection.getInputStream() and then reading from this input stream.

When I use http protocol, everything works fine. But with https, during urlConnection.getInputStream(), I get an exception saying "Bad Record MAC".

I tried to execute the same code in a standalone java program. It went fine with both http and https.

I get this error only when I run in SAP J2EE instance and only with https.

From the exception trace, I can see that while running in J2ee engine, the URLConnection instance is org.w3c.www.protocol.http.HttpURLConnection.

When I run a standalone program from command prompt, the instance is com.ibm.net.ssl.www.protocol.https.r. This runs without any issues.

I understand that these instances are different due to different URLStreamHandlerFactory instances.

But I didnt set the factory instance in either of the programs.

1. Is the exception I get is simply bcoz of instance org.w3c.www.protocol.http.HttpURLConnection?

2. In that case how can I change the factory instance in j2ee engine?

Please help.

Thanks.

Edited by: Who-Am-I on Nov 28, 2009 7:54 AM