This patch adds calls to SSL_get_error() after SSL_read() and SSL_write(), adds SSL_shutdown() before SSL_free(), and changesdefault protocol from SSLv3 to TLSv1.
Bear