Fixed incorrect HTTPS detection.
Merge pull request #2524 from resurtm/2524

Fixed incorrect HTTPS detection.
Enh is bug. #2524.