May 2001
Intermediate to advanced
1088 pages
30h 13m
English
By now, it should be obvious that if you know how to do normal socket programming, using SSL is a no-brainer. One interesting application of SSL is that you can make your own HTTPS server that can accept simple requests.
Listing 35.7 shows a simple Hello World HTTPS server that sends some HTML back to a browser.
package usingj2ee.ssl;import javax.net.ssl.*;import java.io.*;import java.net.*;public class HTTPSHelloServer implements Runnable { protected Socket sock; public HTTPSHelloServer(Socket aSocket) { sock = aSocket; } public void run() { try { // Create the streams to read the request and send the response BufferedReader in = new BufferedReader( new ... |
Read now
Unlock full access