Fixed check of HTTPS downgrade so that works with multiple redirections, and done without an extra request