Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hlu2 committed Oct 3, 2019
2 parents d6cf3d3 + 8a64f3b commit 494461b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Core/HttpClients/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,14 @@ private function setSSL(&$curl_opt, $verifySSL){
if(! in_array($tlsVersion, $versions)){
throw new SdkException("Error. Checking TLS 1.2/1.3 version failed. Please make sure your PHP cURL supports TLS 1.2/1.3");
}
$curl_opt[CURLOPT_SSL_VERIFYPEER] = true;
if($verifySSL){
$curl_opt[CURLOPT_SSL_VERIFYPEER] = true;
$curl_opt[CURLOPT_SSL_VERIFYHOST] = 2;
//based on spec, if TLS 1.2 is supported, it will use the TLS 1.2 or latest version by default
//$curl_opt[CURLOPT_SSLVERSION] = 6;
$curl_opt[CURLOPT_CAINFO] = CoreConstants::getCertPath(); //Pem certification Key Path
} else {
$curl_opt[CURLOPT_SSL_VERIFYHOST] = 0;
}
}

Expand Down

0 comments on commit 494461b

Please sign in to comment.