Parts of this article were adapted from my book SSL and TLS:
Designing and Building Secure Systems, copyright Addison-Wesley 2001, ISBN 0-201-615980-3.
SSL and TLS offers a comprehensive guide to the SSL protocol and its applications.
See www.rtfm.com/sslbook for more information.
Machine-readable source code for the programs presented here can be downloaded from the author's web site,
www.rtfm.com/openssl-examples.
The source code is available under a BSD-style license.
You can get OpenSSL from www.openssl.org.
The documents are available here as well.
The SSLv2 and SSLv3 specifications are available at
http://www.netscape.com/eng/security/SSL_2.html and
http://home.netscape.com/eng/ssl3/index.html.
The specifications for TLS (RFC 2246) and HTTPS (RFC 2818) are available at
www.ietf.org/rfc/rfc2246.txt and
www.ietf.org/rfc/rfc2818.txt.