Learning Python Network Programming

(Sean Pound) #1

Programming with Sockets


Now let's have a look at the application data. Is that encrypted? For the captured
packet, it looks like garbage. The following screenshot shows the encrypted message
that hides the real data. This is what we want to achieve using SSL/TLS.


Summary


In this chapter, we discussed basic TCP/IP socket programming using Python's
socket and ssl module. We demonstrated how simple TCP sockets can be wrapped
with TLS and used to carry encrypted data. We also found the ways to validate
the authenticity of a remote server using SSL certificates. Some other minor issues
around socket programming, such as non-blocking socket I/O were also presented.
The detailed packet analysis in each section helps us to understand what happens
under the hood in our socket programming exercises.


In the next chapter, we will learn about the socket server design, particularly the
popular multithreaded and event-driven approaches will be touched upon.

Free download pdf