Fixes issue #457: incorrect HTTPS detection.