Fixes #276: Undefined index: HTTPS  (replaced previous pull request)

Fixes #276: Undefined index: HTTPS

This pull request replaced the last one for issue #276.  It should be a lot cleaner...