Look at this book:
Network Security With OpenSSL