Fix can force tls version

This commit is contained in:
Laurent Destailleur 2017-05-08 12:08:43 +02:00
parent ab8dcbd366
commit fd6518182b

View File

@ -59,9 +59,11 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it
// TLSv1 by default or change to TLSv1.2 in module configuration
//curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->MAIN_CURL_SSLVERSION)?1:$conf->global->MAIN_CURL_SSLVERSION));
// By default use tls decied by PHP.
// You can force, if supported a version like TLSv1 or TLSv1.2
if (! empty($conf->global->MAIN_CURL_SSLVERSION)) curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION);
//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
//turning off the server and peer verification(TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);