client: add TLS support, fixes #184

Without this we cannot use authenticated connection over TCP, only UNIX
socket is currently supported.