Added TLS support