Java Secure Socket Extension Package Overview

Listing 23.19 is basically the example from Listing 23.15, which just prints out the page found at a given URL. The difference in this example is that it is reading the page from a site that is using SSL. This example does the handshaking with the server and negotiates an encryption algorithm and then gets the text.

Note

You will need to have all three JSSE jar files included in your system CLASSPATH for this example to work correctly.

Code Listing 23.19. Source Code for PrintHTTPSUrlPage Application
 import javax.net.ssl.*; import java.io.*; import java.net.*; import java.security.*; public class PrintHTTPSUrlPage { public static void main(String args[]) throws Exception { System.setProperty("java.protocol.handler.pkgs", ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.