Learning Python Network Programming
Programming with Sockets from ssl import HAS_SNI from pprint import pprint TARGET_HOST = 'www.google.com' SSL_PORT = 443 # Use t ...
Chapter 7 cert = ssl_socket.getpeercert() pprint(cert) if not cert or ('commonName', TARGET_HOST) not in cert['subject'][4]: rai ...
Programming with Sockets If the CA certificate parameter has been presented with a certificate path, the load_verify_locations() ...
Chapter 7 Interestingly, if any other fake web server wants to pretend to be the Google's web server, it simply can't do that, p ...
Programming with Sockets Let us examine the SSL handshake process between the client and the server. In the first step of a SSL ...
Chapter 7 In the second phase of the SSL handshake, the server sends an SSL certificate to the client. This certificate is issue ...
Programming with Sockets In the third phase of the handshake, the client exchanges a key and calculates a master secret to encry ...
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 l ...
Programming with Sockets server_socket.bind(('', SSL_SERVER_PORT)) server_socket.listen(5) print("Waiting for ssl client on port ...
Chapter 7 # get remote cert cert = ssl_conn.getpeercert() print("Checking server certificate") pprint(cert) if not cert or ssl.m ...
Programming with Sockets Inspecting interaction between a custom SSL client/server Let us inspect the SSL client/server interact ...
Chapter 7 The client's Client Hello packet looks pretty similar to our previous SSL connection, as shown in the following screen ...
Programming with Sockets The server's Server Hello packet is a bit different. Can you identify the differences? The cipher speci ...
Chapter 7 The Client key exchange packet also looks very familiar, as shown in the following screenshot: The following screensho ...
Programming with Sockets Now let's have a look at the application data. Is that encrypted? For the captured packet, it looks lik ...
Client and Server Applications In the previous chapter, we looked at exchanging data between devices by using the sockets interf ...
Client and Server Applications Client and server The basic setup in the client/server model is one device, the server that runs ...
Chapter 8 Our echo server should listen until a client connects and sends a bytes string, then we want it to echo that string ba ...
Client and Server Applications Option 1 is a good choice for very simple protocols. It's easy to implement and it doesn't requir ...
Chapter 8 A simple echo server As we work through this chapter, we'll find ourselves reusing several pieces of code, so to save ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf