Advanced Networking Examples

This directory contains some sample code related to SSL handshaking between different machines using different protocols and libraries. Please consult http://docs.python.org/library/ssl for important information concerning these examples.

Preliminaries

To do any kind of work with SSL you first need to have a set of public/private keypairs and a set of certificates. Generating the keys and certificates are outside the scope of Python. Consult documentation for OpenSSL or related package for more information.

For these examples, a set of keys and certificates have been made already:

Example 1 : A Simple SSL Server/Client

An example of an SSL server that presents a signed certificate to clients. The client code verifies the server identity using the certificate authority (CA) certificate.

Example 2 : A SSL Server/Client with paired certificates

An example of an SSL server that requires clients to present certificates that are verified against a trusted certificate authority.

Example 3 : An SSL XML-RPC Server with paired certificates

An example of creating an XML-RPC server that uses SSL and requires clients to present certificates signed by a trusted certificate authority.

Example 4: An SSL Web Server with paired certificates

An example of creating an HTTP server that uses SSL as well as using urllib2 to provide client certificates.

If you try to connect to this server using a normal web browser at https://localhost:8080, you should get an error message rejecting the connection due to bad certicates. The only to connect is to present a certificate as shown in the ssl_urllib.py code.


Last modified: Sun May 22 12:18:36 CDT 2011