Added support for SSL and STARTTLS.