N°1260 remove db_tls.verify_server_cert : the server cert verification is now based on the TLS CA parameter value

SVN:trunk[5683]
This commit is contained in:
Pierre Goiffon
2018-04-18 07:26:11 +00:00
parent f07bbfa174
commit aa8072118d
5 changed files with 13 additions and 38 deletions

View File

@@ -42,12 +42,10 @@ class iTopMutex
protected $sDBSubname;
protected $bDBTlsEnabled;
protected $sDBTlsCA;
protected $bDBTlsVerifyServerCert;
static protected $aAcquiredLocks = array(); // Number of instances of the Mutex, having the lock, in this page
public function __construct(
$sName, $sDBHost = null, $sDBUser = null, $sDBPwd = null, $bDBTlsEnabled = false, $sDBTlsCA = null,
$bDBTlsVerifyServerCert = null
$sName, $sDBHost = null, $sDBUser = null, $sDBPwd = null, $bDBTlsEnabled = false, $sDBTlsCA = null
)
{
// Compute the name of a lock for mysql
@@ -65,7 +63,6 @@ class iTopMutex
$this->bDBTlsEnabled = is_null($bDBTlsEnabled) ? $oConfig->Get('db_tls.enabled') : $bDBTlsEnabled;
$this->sDBTlsCA = is_null($sDBTlsCA) ? $oConfig->Get('db_tls.ca') : $sDBTlsCA;
$this->bDBTlsVerifyServerCert = is_null($bDBTlsVerifyServerCert) ? $oConfig->Get('db_tls.verify_server_cert') : $bDBTlsVerifyServerCert;
$this->sName = $sName;
if (substr($sName, -strlen($this->sDBName.$sDBSubname)) != $this->sDBName.$sDBSubname)
@@ -235,10 +232,8 @@ class iTopMutex
$sSource = $this->sDBName;
$bTlsEnabled = $this->bDBTlsEnabled;
$sTlsCA = $this->sDBTlsCA;
$bTlsVerifyServerCert = $this->bDBTlsVerifyServerCert;
$this->hDBLink = CMDBSource::GetMysqliInstance($sServer, $sUser, $sPwd, $sSource, $bTlsEnabled, $sTlsCA,
false, $bTlsVerifyServerCert);
$this->hDBLink = CMDBSource::GetMysqliInstance($sServer, $sUser, $sPwd, $sSource, $bTlsEnabled, $sTlsCA, false);
if (!$this->hDBLink)
{