Moving SSL check away from the port number and supporting SSL termination. #920 Closes #862
Removing reference to $_SERVER[HTTP_HOST]. #638