TLS support. closes #18