Learning Python Network Programming

(Sean Pound) #1
Chapter 7

Creating a custom SSL client/server


So far, we have been dealing more with the SSL or TLS client. Now, let us have a
look at the server side briefly. As you are already familiar with the TCP/UDP socket
server creation process, let's skip that part and just concentrate on the SSL wrapping
part. The following code snippet shows an example of a simple SSL server:


import socket
import ssl

SSL_SERVER_PORT = 8000

if __name__ == '__main__':
server_socket = socket.socket()
Free download pdf