From: James D. Forrester Date: Thu, 24 May 2018 20:03:18 +0000 (-0700) Subject: PhpHttpRequest: Drop back-compat code for PHP 5.5 and before X-Git-Tag: 1.34.0-rc.0~5237^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=575504ede088667352509e01b749b1eae6744a72;p=lhc%2Fweb%2Fwiklou.git PhpHttpRequest: Drop back-compat code for PHP 5.5 and before Change-Id: Ic2b144e333639dfeff0a86b14e4b4927e9bf6db0 --- diff --git a/includes/http/PhpHttpRequest.php b/includes/http/PhpHttpRequest.php index 0f499c2302..30ab181e1d 100644 --- a/includes/http/PhpHttpRequest.php +++ b/includes/http/PhpHttpRequest.php @@ -137,13 +137,7 @@ class PhpHttpRequest extends MWHttpRequest { } if ( $this->sslVerifyHost ) { - // PHP 5.6.0 deprecates CN_match, in favour of peer_name which - // actually checks SubjectAltName properly. - if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) { - $options['ssl']['peer_name'] = $this->parsedUrl['host']; - } else { - $options['ssl']['CN_match'] = $this->parsedUrl['host']; - } + $options['ssl']['peer_name'] = $this->parsedUrl['host']; } $options['ssl'] += $this->getCertOptions(); @@ -169,19 +163,6 @@ class PhpHttpRequest extends MWHttpRequest { restore_error_handler(); if ( !$fh ) { - // HACK for instant commons. - // If we are contacting (commons|upload).wikimedia.org - // try again with CN_match for en.wikipedia.org - // as php does not handle SubjectAltName properly - // prior to "peer_name" option in php 5.6 - if ( isset( $options['ssl']['CN_match'] ) - && ( $options['ssl']['CN_match'] === 'commons.wikimedia.org' - || $options['ssl']['CN_match'] === 'upload.wikimedia.org' ) - ) { - $options['ssl']['CN_match'] = 'en.wikipedia.org'; - $context = stream_context_create( $options ); - continue; - } break; }