Added support for TLS encryption

Ditto