SESSION 6: HTTP SECURITY ======================== 0.- Understand what HTTPS is and how it works. A good starting point is: http://docencia.ac.upc.edu/FIB/PXC/manel/LAB/http_authentication.txt 1.- Download the required files: - This source code: http://docencia.ac.upc.edu/FIB/PXC/lab/_seg/pxc-p6-codigo.tar.gz (HTTPServer is a simple HTTP server implemented in java. We're gonna modify it to add authentication and encryption (SSL/TSL) functionalities.) - And a base64 lib: http://docencia.ac.upc.edu/FIB/PXC/lab/base64-1.4.zip 2.- HTTPServer: Compile and execute HTTPServer. Use a web browser to browse 'http://localhost/'. It should show you 'index.html' 3.- BASIC AUTHENTICATION: Modify HTTPServer source code to implement basic authentication. 4.- GENERATE CERTIFICATES FOR SSL: 4.a) Understand what 'keytool' is and how it works. A good starting point is: http://java.sun.com/javase/6/docs/technotes/tools/solaris/keytool.html 4.b) Generate a certificate. Something like the following should do it: $ keytool -genkey -keyalg RSA -alias selfsigned -keypass serverkspw -storepass serverkspw -keystore certs # It is important that when 'keytool' asks for 'first and last name' we type the hostname where the server's gonna run. In our case "localhost". 5.- SECURE SERVER: 5.a) Compile HTTPServer and SecureServer. Since SecureServer uses HTTPServer, and HTTPServer now implements authentication, our SecureServer will also use authentication. 5.b) Start the SecureServer and point with a browser to https://localhost:4430/ to verify that it works.