OpenSSL
Here is a worksheet/guide to the OpenSSL command tool: Here
Here are some useful links:
There are many excellent books on the subject of SSL\TLS but for me the best has to be Network Security with OpenSSL.
C Hints and tips:
sprintf - http://www.rohitab.com/discuss/static/topic-3-18-11505-0.html