Workaround fopen lack of SubjectAltName support for instantCommons
authorBrian Wolff <bawolff+wn@gmail.com>
Wed, 1 Jul 2015 08:15:39 +0000 (02:15 -0600)
committerGergő Tisza <gtisza@wikimedia.org>
Sun, 30 Aug 2015 01:47:50 +0000 (01:47 +0000)
commitbb2adc239410563eeddd6f9017b62187c859fed6
treed96d7d434185e2fd665823079ef65c790a8fc8ff
parent4e76d225e68b7041103210ceadaa02bd88317db5
Workaround fopen lack of SubjectAltName support for instantCommons

Hacky work around, where on php < 5.6.0 where SubjectAltName is not
supported, if a request to commons.wikimedia.org fails, retry the
request but telling php fopen wrapper to treat it as if it came
from en.wikipedia.org for validation purposes, since as of
c02fab71422a that's what the common name of the cert will be.

In the ideal world, everyone would just have curl installed.

I know this is super hacky, but I'd really like instant commons to
work out of the box even without curl installed.

Note: I'm basing the php 5.6 part on documentation, I have not tested
this with a copy of that version of php.

Bug: T75199
Change-Id: Ibde59be61a5b3d7cd5397ba352dce9be11e1b06f
includes/HttpFunctions.php