When a page is setup to redirect to the existing page in SSLOffload environment, null reference exception occurs when the page is typed in from the browser
In this scenario Page2 is setup to redirect to Page3. Please check the attached file for details on configuration.
1. Setup SSL Settings
2. Setup Page2 to redirect to Page3
3. Request Page2 from a browser (e.g https://dnndev.me/Home/Page2)
After investigation, the exception is from the function
IsSecureConnectionOrSslOffload(HttpRequest request) where the PortalSettings is null and it was used to get the ActiveTab information.
In our opinion for this scenario, checking the IsSecure of the Active Tab is not related to determining whethere a request is secure or not.
Our suggestion on fixing is as following.
public static bool IsSecureConnectionOrSslOffload(HttpRequest request)
string ssloffloadheader = HostController.Instance.GetString("SSLOffloadHeader", "");
//if the ssloffloadheader variable has been set check to see if a request header with that type exists
string ssloffload = request.Headers[ssloffloadheader];