From Theory to Application
TCP provides the reliability that the SSL API needs. SSL adds more handshaking so that both the client and server can use the best ciphers and ensure that you have a private link. Part 2 of this article describes how to use OpenSSL, a production-ready API, for connecting with secure clients and servers.
If you want to learn more about socket programming and SSL, pick up Linux Socket Programming (Sams Publishing, 2001, ISBN 0-672-31935-7). You can get source code for this article from the Linux Socket web site.