Currently requests coming a reverse proxy (so set in sys_trusted_proxies) does take into account the header X-Forwarded-Proto.
This header should be taken into account otherwise some valid requests by be rejected because they are not considered to be done over HTTPS.