tls redirect bug fixes #12