Add support for TLS (#46)

Closes GH-38
6 files changed