From 23b8c5d050813ebcdd553386e4b05f3d444208bf Mon Sep 17 00:00:00 2001
From: Cameron <e107inc@gmail.com>
Date: Thu, 9 Feb 2017 10:01:28 -0800
Subject: [PATCH] Issue #2407 - SSL detection improvement.

---
 e107_handlers/e107_class.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php
index b3b0dcef9..efd8d149a 100644
--- a/e107_handlers/e107_class.php
+++ b/e107_handlers/e107_class.php
@@ -3836,7 +3836,7 @@ class e107
 	{
 		// ssl_enabled pref not needed anymore, scheme is auto-detected
 		$this->HTTP_SCHEME = 'http';
-		if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
+		if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443)
 		{
 			$this->HTTP_SCHEME =  'https';
 		}