mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-06 17:44:12 +01:00
N°1260 MySQL TLS connection : apply Hardis patch (many thanks !)
SVN:trunk[5306]
This commit is contained in:
@@ -1026,13 +1026,13 @@ EOF
|
||||
*
|
||||
* @return mixed false if the connection failed or array('checks' => Array of CheckResult, 'databases' => Array of database names (as strings) or null if not allowed)
|
||||
*/
|
||||
static function CheckDbServer($sDBServer, $sDBUser, $sDBPwd)
|
||||
static function CheckDbServer($sDBServer, $sDBUser, $sDBPwd, $sSSLKey = NULL, $sSSLCert = NULL, $sSSLCA = NULL, $sSSLCipher = NULL)
|
||||
{
|
||||
$aResult = array('checks' => array(), 'databases' => null);
|
||||
try
|
||||
{
|
||||
$oDBSource = new CMDBSource;
|
||||
$oDBSource->Init($sDBServer, $sDBUser, $sDBPwd);
|
||||
$oDBSource->Init($sDBServer, $sDBUser, $sDBPwd, '', $sSSLKey, $sSSLCert, $sSSLCA, $sSSLCipher);
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::INFO, "Connection to '$sDBServer' as '$sDBUser' successful.");
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::INFO, "Info - User privileges: ".($oDBSource->GetRawPrivileges()));
|
||||
|
||||
@@ -1112,10 +1112,10 @@ EOF
|
||||
return false;
|
||||
}
|
||||
|
||||
static public function GetMySQLVersion($sDBServer, $sDBUser, $sDBPwd)
|
||||
static public function GetMySQLVersion($sDBServer, $sDBUser, $sDBPwd, $sSSLKey = NULL, $sSSLCert = NULL, $sSSLCA = NULL, $sSSLCipher = NULL )
|
||||
{
|
||||
$oDBSource = new CMDBSource;
|
||||
$oDBSource->Init($sDBServer, $sDBUser, $sDBPwd);
|
||||
$oDBSource->Init($sDBServer, $sDBUser, $sDBPwd, '', $sSSLKey, $sSSLCert, $sSSLCA, $sSSLCipher);
|
||||
$sDBVersion = $oDBSource->GetDBVersion();
|
||||
return $sDBVersion;
|
||||
}
|
||||
@@ -1126,10 +1126,15 @@ EOF
|
||||
$sDBUser = $aParameters['db_user'];
|
||||
$sDBPwd = $aParameters['db_pwd'];
|
||||
$sDBName = $aParameters['db_name'];
|
||||
$sSSLKey = $aParameters['db_ssl_key'];
|
||||
$sSSLCert = $aParameters['db_ssl_cert'];
|
||||
$sSSLCA = $aParameters['db_ssl_ca'];
|
||||
$sSSLCipher = $aParameters['db_ssl_cipher'];
|
||||
|
||||
$oPage->add_ready_script('oXHRCheckDB = null;');
|
||||
|
||||
$checks = SetupUtils::CheckDbServer($sDBServer, $sDBUser, $sDBPwd);
|
||||
$checks = SetupUtils::CheckDbServer($sDBServer, $sDBUser, $sDBPwd, $sSSLKey, $sSSLCert, $sSSLCA, $sSSLCipher);
|
||||
|
||||
if ($checks === false)
|
||||
{
|
||||
// Connection failed, disable the "Next" button
|
||||
|
||||
Reference in New Issue
Block a user