The rest of the HTTPS patch

But, we still don't support Hybi, which is problematic.