waleedehsan1
03/21/2022, 10:47 AM<cfset protocol = 'http' />
<cfif any cgi or server scope variable tell us ssl is enable >
<cfset protocol = 'https' />
</cfif>
bhartsfield
03/21/2022, 11:53 AMwaleedehsan1
03/21/2022, 6:58 PMwaleedehsan1
03/21/2022, 6:58 PMbhartsfield
03/21/2022, 7:01 PMbdw429s
03/21/2022, 7:14 PMbdw429s
03/21/2022, 7:14 PMbdw429s
03/21/2022, 7:15 PM/**
* Are we in SSL or not? This method looks at CGI.SERVER_PORT_SECURE for indication
*/
boolean function isSSL(){
if ( isBoolean( CGI.SERVER_PORT_SECURE ) AND CGI.SERVER_PORT_SECURE ) {
return true;
}
// Add typical proxy headers for SSL
if ( getHTTPHeader( "x-forwarded-proto", "http" ) eq "https" ) {
return true;
}
if ( getHTTPHeader( "x-scheme", "http" ) eq "https" ) {
return true;
}
// CGI.HTTPS
if ( CGI.keyExists( "HTTPS" ) and CGI.HTTPS eq "on" ) {
return true;
}
return false;
}
bdw429s
03/21/2022, 7:15 PMwaleedehsan1
03/21/2022, 7:15 PMbdw429s
03/21/2022, 7:16 PMusing services of cloudflareCloudflare does offer the feature of SSL termination, but that doesn't necessarily tell us if your client is using it.