as tflight said, it can be a proxy problem. For example, if your webserver works like :
[client] =(:443)=> [proxy] =(:80)=> [php]
So it looks like HTTPs because between client and proxy you have :443 TCP connection, but in fact PHP recieves requests on port 80.
So, if you can tell us more about you webservers config (cloudflare, etc), maybe we can find the bug