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.
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:
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.
An example of an SSL server that requires clients to present certificates that are verified against a trusted certificate authority.
An example of creating an XML-RPC server that uses SSL and requires clients to present certificates signed by a trusted certificate authority.
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.