Hynek Schlawack | 8b7e455 | 2016-03-13 07:51:09 +0100 | [diff] [blame] | 1 | ======== |
| 2 | Examples |
| 3 | ======== |
| 4 | |
| 5 | |
| 6 | certgen.py -- Certificate generation module |
| 7 | =========================================== |
| 8 | |
| 9 | Example module with three functions: |
| 10 | |
| 11 | createKeyPair |
| 12 | Create a public/private key pair. |
| 13 | |
| 14 | createCertRequest |
| 15 | Create a certificate request. |
| 16 | |
| 17 | createCertificate |
| 18 | Create a certificate given a cert request. |
| 19 | |
| 20 | In fact, I created the certificates and keys in the 'simple' directory with the script ``mk_simple_certs.py``. |
| 21 | |
| 22 | |
| 23 | simple -- Simple client/server example |
| 24 | ====================================== |
| 25 | |
| 26 | Start the server with:: |
| 27 | |
| 28 | python server.py PORT |
| 29 | |
| 30 | and start clients with:: |
| 31 | |
| 32 | python client.py HOST PORT |
| 33 | |
| 34 | The server is a simple echo server, anything a client sends, it sends back. |
| 35 | |
| 36 | |
| 37 | proxy.py -- Example of an SSL-enabled proxy |
| 38 | =========================================== |
| 39 | |
| 40 | The proxy example demonstrate how to use set_connect_state to start talking SSL over an already connected socket. |
| 41 | |
| 42 | Usage:: |
| 43 | |
| 44 | python proxy.py server[:port] proxy[:port] |
| 45 | |
| 46 | Contributed by Mihai Ibanescu |
| 47 | |
| 48 | |
| 49 | SecureXMLRPCServer.py -- SSL-enabled version of SimpleXMLRPCServer |
| 50 | ================================================================== |
| 51 | |
| 52 | Acts exactly like `SimpleXMLRPCServer <https://docs.python.org/3/library/xmlrpc.server.html>`_ from the Python standard library, but uses secure connections. |
| 53 | The technique and classes should work for any SocketServer style server. |
| 54 | However, the code has not been extensively tested. |
| 55 | |
| 56 | Contributed by Michal Wallace |