Rewritten SSL handling, using TLS as default.