Update 'phpInterface/shoppingList.php'

Added Mysql SSL
This commit is contained in:
jens 2022-03-15 13:02:42 +01:00
parent f7c470f5a1
commit 78b35b84f2

View File

@ -47,7 +47,14 @@
{ {
if(DBLink::$sqlLink == null) if(DBLink::$sqlLink == null)
{ {
DBLink::$sqlLink = new mysqli(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort); DBLink::$sqlLink = mysqli_init();
if(Configuration::$mysqlSSL)
{
DBLink::$sqlLink->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);
DBLink::$sqlLink->ssl_set(NULL, NULL, Configuration::$mysqlSslCertificatePath, NULL, NULL);
}
DBLink::$sqlLink->real_connect(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort);
// Verbindung überprüfen // Verbindung überprüfen
if (mysqli_connect_errno()) if (mysqli_connect_errno())