-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
1.4
-
x86
-
windows_2000
Name: gm110360 Date: 11/28/2001
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
Problem:
When trying to HTTPS post request using ObjectOutputStream from applet,
Plug-in Applet in Netscape6.2 hangs by calling stream's close();
This problem occurs only in Netscape6.2 + Java Plug-in Applet(JRE_1.3.1_01)
with HTTPS
and normal HTTP connection works fine even in Netscape6.2 + Java Plug-in Applet
(JRE_1.3.1_01).
HTTPS + IE6.0 + Java Plug-in doesn't cause this problem. They always work
fine.
Detail:
When calling ObjectOutputStream's close(), never returns from close(). No
Exception occurs.
no HTTPS request comes to web server according to ssl_request.log etc.
Next I monitored the encrypted TCP packets sent from browser to http server to
see if this is a server's problem or client's,
and The result was that no paket was sent from Client PC.
So I consider this is Plug-in Applet's problem or maybe Netscape API because
Java Plug-in leverages the HTTPS support in the browser and uses the browser's
API for making HTTPS connections according to
http://java.sun.com/products/jdk/1.2/https.html.
and I took some time for further testing about Nestcape 6.2.
1) GET method works fine.
This can be tested by changing following applet class code with these codes.
con.setUseCaches(false);
con.setDoOutput(false);
con.setDoInput(true);
con.setRequestProperty("Content-type","application/octet-stream");
dis = new ObjectInputStream(new BufferedInputStream(con.getInputStream()));
String text = (String)dis.readObject();
dis.close();
2) Using OutputStream doesn't cause this problem. Only ObjectOutputStream and
DataOutputStream reproduce.
This can be tested by using following codes and some modification of servlet.
con.setUseCaches(false);
con.setDoOutput(true);
OutputStream outstream = con.getOutputStream();
outstream.write(500);
outstream.close();
Environment:
Server:
LASER5 Linux 7.1
Apache/1.3.22
mod_ssl/2.8.5
OpenSSL/0.9.6b
J2SE 1.3.1_01
Tomcat 3.3
Client:
Windows2000
Internet Explorer 5.5sp2 / 6.0
Netscape6.1 / 6.2
JRE_1.3.1_01
Reproducing:
-------- applet ---------------
package test;
import javax.swing.*;
import java.net.*;
import java.io.*;
public class TestApplet extends JApplet
{
public void init()
{
try{
URL url = new URL("https://servername/servlet/test.TestServlet");
URLConnection con = url.openConnection();
con.setUseCaches(false);
con.setDoOutput(true);
con.setDoInput(true);
con.setRequestProperty("Content-type","application/octet-stream");
ObjectOutputStream oos=new ObjectOutputStream(new BufferedOutputStream
(con.getOutputStream()));
String text = "Test String";
oos.writeObject(text);
oos.flush();
System.out.println("flush ok");
oos.close();
System.out.println("close ok but never comes here with Netscape");
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream
(con.getInputStream()));
ois.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
-------- servlet ---------------
package test;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class TestServlet extends HttpServlet
{
public void service( HttpServletRequest request, HttpServletResponse response)
{
try
{
System.out.println("request came");
ObjectInputStream ois = new ObjectInputStream(request.getInputStream());
String s = (String)ois.readObject();
System.out.println("string is "+s);
ois.close();
ObjectOutputStream oos = new ObjectOutputStream(response.getOutputStream());
oos.writeObject(s);
oos.flush();
oos.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
(Review ID: 135963)
======================================================================