How can my application or applet programmatically use HTTPS to talk to a servlet? Can I do it with just the Java 2 SDK?

Tim Rohaly

In order to use secure sockets, you need an SSL implementation. this is not provided in the Java 2 SDK.

If you are running an applet, the major browsers provide support for HTTPS through the java.net.URL class - simply specify a protocol of "https" in your URL string and the details are handled for you.

If you are running a standalone application, or want to use SSL over your own sockets and avoid using URL or URLConnection, then you need to obtain an implementation of the Java Secure Socket Extension, or JSSE.

Sun provides a reference implementation of JSSE, along with sample programs, which you can download from http://java.sun.com/products/jsse/. It comes in both a "domestic version" (US/Canada) and an "export version" (all other countries).