Support TLS, dynamic listeners and encrypted storage

You might want to use `subtle.ConstantTimeCompare` compare here: http://golang.org/pkg/crypto/subtle/#ConstantTimeCompare

This maybe not be an issue right now, but looks like it could potentially be a timing attack.