Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
MYSQLI_CLIENT_SSL, mysqli_connect, SSL, Azure
Write your message below:
Hi everyone, I found this forum but unfortunately I couldn't find the solution to my problem. I would like to share with you if anyone knows how to solve, please share it!
My HESK is published on Azure.
My environment is a Linux WebApp with PHP7.2.
And my database is a MySQL Database from Azure.
To meet some security requirements, we had to enable SSL-ENFORCED in the MySQL Azure Database and include the ips of the WebApp in the db access permissions, as well as determine the best practices. My problem is in the connection string between HESK and the database, when accessing the page it returns the following message: (9002) SSL connection is required. Please specify SSL options and retry.
I don't know how to proceed with this configuration in the db connection string.
File: database_mysqli.inc.php
Code:
I tried several searches on Google, but they always say to set up certificates for the database, which is not my case, I just need to inform the system that I should force the use of SSL.function hesk_dbConnect()
{
global $hesk_settings;
global $hesk_db_link;
global $hesklang;
// Do we have an existing active link?
if ($hesk_db_link)
{
return $hesk_db_link;
}
// Is mysqli supported?
if ( ! function_exists('mysqli_connect') )
{
die($hesklang['emp']);
}
// Do we need a special port? Check and connect to the database
if ( strpos($hesk_settings['db_host'], ':') )
{
list($hesk_settings['db_host_no_port'], $hesk_settings['db_port']) = explode(':', $hesk_settings['db_host']);
$hesk_db_link = @mysqli_connect($hesk_settings['db_host_no_port'], $hesk_settings['db_user'], $hesk_settings['db_pass'], $hesk_settings['db_name'], intval($hesk_settings['db_port']) );
}
else
{
$hesk_db_link = @mysqli_connect($hesk_settings['db_host'], $hesk_settings['db_user'], $hesk_settings['db_pass'], $hesk_settings['db_name']);
}
// Errors?
if ( ! $hesk_db_link)
{
if ($hesk_settings['debug_mode'])
{
hesk_error("$hesklang[cant_connect_db]</p><p>$hesklang[mysql_said]:<br />(".mysqli_connect_errno().") ".mysqli_connect_error()."</p>");
}
else
{
hesk_error("$hesklang[cant_connect_db]</p><p>$hesklang[contact_webmsater] <a href=\"mailto:$hesk_settings[webmaster_mail]\">$hesk_settings[webmaster_mail]</a></p>");
}
}
// Check MySQL/PHP version and set encoding to utf8
hesk_dbSetNames();
// Set the correct timezone
hesk_dbSetTimezone();
return $hesk_db_link;
} // END hesk_dbConnect()
Does anyone have an example or solution?
Thanks!