How to protect an Applet-HttpServlet-Connection with SSL

Hello,

I've programmed an HttpServlet running with Apache and Tomcat.
This Servlet is accessed by an Applet via

URL url = new URL("http://...");
URLConnection con = urlServlet.openConnection();
...

Now the question is how to make this connection secure with SSL or TLS?
(Can I keep the HttpServlet-Applet-architecture and just put some additional SSL/TLS stuff on it?)

Can anybody help?

Thanks!
[461 byte] By [Oktopus] at [2007-11-20 0:10:47]
# 1 Re: How to protect an Applet-HttpServlet-Connection with SSL
Hi,

have a look at javax.net.ssl.HttpsURLConnection.
Bnt at 2007-11-10 2:18:51 >
# 2 Re: How to protect an Applet-HttpServlet-Connection with SSL
Thanks Bnt,

Now my applet opens the connection like

URL url = new URL("https://...");
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();

It seems the servlet doesn't react in any way. (Would have been a surprise if it did.)

So what needs to be done at the servlet side of the connection?
Is there possibly a servlet class for SSL connections?
Oktopus at 2007-11-10 2:19:51 >
# 3 Re: How to protect an Applet-HttpServlet-Connection with SSL
Thats all you have to do from a coding point of view, it's like browsing the web, if you want to open a secure connection you type https in your address bar instead of http. The server handles the connection. But you do have to have SSL set up on your server, ie: have a certificate, etc...
Bnt at 2007-11-10 2:20:52 >