So... apparently PHP had a bug where using
Yep. That's a case-sensitive comparison against a lowercase
https://marc.info/?l=php-cvs&m=103150354009407&w=1
A single character comparison deciding whether a connection gets encrypted... for over two decades. 😅
httpS:// (with a capital S) could cause data intended for HTTPS to be sent in plaintext.
And it looks like this bug has been around for over 24 years.
https://x.com/mattiasgeniar/status/2123436542995964123
If you're like me and immediately want to see the code responsible, here it is:
c
use_ssl = (ZSTR_LEN(resource->scheme) > 4) && ZSTR_VAL(resource->scheme)[4] == 's';
s.
https://github.com/php/php-src/blob/1c5b0e5b128ca0c762ba554141dbca3245651005/ext/standard/http_fopen_wrapper.c#L484
Even better, this logic appears to trace back to code written in 2002 (apparently by Stefan Esser) to support secure FTP:
c
use_ssl = resource->scheme && (strlen(resource->scheme) > 3) && resource->scheme[3] == 's';
commit 91298ea