MDL-56917 core_upgrade: Do not use the raw version to check cURL caps.

Some Linux distros can backport features due to security issues
while keeping the same (old) version. See e.g.:
- RHEL 7, https://rhn.redhat.com/errata/RHSA-2015-2159.html
- RHEL 6, https://rhn.redhat.com/errata/RHBA-2016-0842.html
- Remi PHP 7.0.x, 87954ef9ca
This commit is contained in:
Matteo Scaramuccia 2016-11-12 23:35:40 +01:00
parent 0b8e0c374f
commit ade30c673c
2 changed files with 4 additions and 18 deletions

View file

@ -86,7 +86,9 @@ final class util {
* @return bool
*/
public static function can_use_tls12(array $curlinfo, $uname) {
if ($curlinfo['version_number'] < 467456 || !defined('CURL_SSLVERSION_TLSv1_2')) {
// Do not compare the cURL version, e.g. $curlinfo['version_number'], with v7.34.0 (467456):
// some Linux distros backport security issues and keep lower version numbers.
if (!defined('CURL_SSLVERSION_TLSv1_2')) {
return false;
}