Wrong HTTP protocol in combination with a proxy
When a reverse proxy is configured in $TYPO3_CONF_VARS and you call
t3lib_div::getIndpEnv('TYPO3_SSL') it returns the wrong protocol.
You can reproduce this in the following way:
If realUrl has the configuration to take the next higher level in the page tree in the case of not finding the current page
then the protocol will be changed by the static method t3lib_div::getIndpEnv('TYPO3_SSL')