X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpc.inc;h=e5be7f7c858315e2a7ba51c467183b7e06e4d363;hb=4d3f0dd566fa18a47ffc4e7e46e6c51785f56013;hp=ea775f82e6daeba0f8a8799f8d4e5ba3401716d9;hpb=d4a01160eb1e5c9853c1610b9e144257a707538f;p=plcapi.git diff --git a/lib/xmlrpc.inc b/lib/xmlrpc.inc index ea775f8..e5be7f7 100644 --- a/lib/xmlrpc.inc +++ b/lib/xmlrpc.inc @@ -1621,6 +1621,13 @@ { curl_setopt($curl, CURLOPT_SSLKEYPASSWD, $keypass); } + + // Upgrade transparently to more stringent check for versions of php which do not support otherwise. + // Doing it in constructor would be cleaner; doing it here saves us a couple of function calls + if($this->verifyhost == 1 && $info = curl_version() && version_compare($info['version'], '7.28.1') >= 0) + { + $this->verifyhost = 2; + } // whether to verify cert's common name (CN); 0 for no, 1 to verify that it exists, and 2 to verify that it matches the hostname used curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $this->verifyhost); }