We have recently applied SSL certificate on our website and we want all our url to have https:// protocol.
Once we moved our website to https://, our website broke down
Check the $_SERVER['HTTPS'] value. This should be set to on or 1. If it has any other value while being set, this function will output http rather than https.
$_SERVER['HTTPS']
on
1
See: https://core.trac.wordpress.org/browser/tags/4.5.3/src/wp-includes/functions.php#L4025