N
Ng Wee Peng
Hello,
I have an applet that communicates with a Servlet in the web server.
The web server has been configured for secured access by SSL. I am
unable to get the applet to communicate with the servlet over HTTPS. I
would appreciate any help or pointers in solving this problem.
Right now, the applet talks to the servlet over normal HTTP and it
works fine. However, when I switch the communication protocol to
HTTPS, I get this error message in the Java console:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
connection?
I am using Java plugin 1.4 on an Internet Explorer 6 browser.
Java(TM) Plug-in: Version 1.4.2
Using JRE version 1.4.2 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\ngwp
Proxy Configuration: No proxy
Here is an excerp of the applet code that communicates with servlet.
The applet is sending an object to the servlet, and is expecting an
object in return from the Servlet.
URL url = new URL("https://somesite:80/TestServlet?param=test");
URLConnection servletConnection = url.openConnection();
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
servletConnection.setUseCaches(false);
servletConnection.setDefaultUseCaches(false);
servletConnection.setRequestProperty("Content-Type",
"application/octet-stream");
if (obj != null) {
ObjectOutputStream outputToServlet = new ObjectOutputStream(
servletConnection.getOutputStream());
outputToServlet.writeObject(obj);
outputToServlet.flush();
outputToServlet.close();
}
ObjectInputStream inputFromServlet = new ObjectInputStream(
servletConnection.getInputStream());
Object objreceived = inputFromServlet.readObject();
inputFromServlet.close();
Thanks
I have an applet that communicates with a Servlet in the web server.
The web server has been configured for secured access by SSL. I am
unable to get the applet to communicate with the servlet over HTTPS. I
would appreciate any help or pointers in solving this problem.
Right now, the applet talks to the servlet over normal HTTP and it
works fine. However, when I switch the communication protocol to
HTTPS, I get this error message in the Java console:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
connection?
I am using Java plugin 1.4 on an Internet Explorer 6 browser.
Java(TM) Plug-in: Version 1.4.2
Using JRE version 1.4.2 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\ngwp
Proxy Configuration: No proxy
Here is an excerp of the applet code that communicates with servlet.
The applet is sending an object to the servlet, and is expecting an
object in return from the Servlet.
URL url = new URL("https://somesite:80/TestServlet?param=test");
URLConnection servletConnection = url.openConnection();
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
servletConnection.setUseCaches(false);
servletConnection.setDefaultUseCaches(false);
servletConnection.setRequestProperty("Content-Type",
"application/octet-stream");
if (obj != null) {
ObjectOutputStream outputToServlet = new ObjectOutputStream(
servletConnection.getOutputStream());
outputToServlet.writeObject(obj);
outputToServlet.flush();
outputToServlet.close();
}
ObjectInputStream inputFromServlet = new ObjectInputStream(
servletConnection.getInputStream());
Object objreceived = inputFromServlet.readObject();
inputFromServlet.close();
Thanks