'Connecting to phpmyadmin xampp mysql server over ssl

I was setting up a local server on my mac using xampp, however i ran into a problem when i needed to set up ssl for my site. I set up the php side to enable ssl that works fine, I can visit 'https://localhost/' fine it loads up the xampp welcome page. Now when it comes to mysql and setting it up to use ssl i cant get it to use ssl. When i go into phpmyadmin and check the variables it says that ssl isn't on and that there is no cipher specified.

I tried going into the config.inc.php and adding the following lines:

    $cfg['Servers'][$i]['ssl'] = true;
    $cfg['ForceSSL'] = TRUE;

I then restarted apache and mysql servers through xampp and that changed nothing. I then generated my own certificates put them in a folder and added the following to the same config.inc.php file:

    $cfg['Servers'][$i]['ca'] = '/Applications/XAMPP/xamppfiles/etc/ssl/ca-cert.pem';
    $cfg['Servers'][$i]['cert'] = '/Applications/XAMPP/xamppfiles/etc/ssl/client-cert.pem';
    $cfg['Servers'][$i]['key'] = '/Applications/XAMPP/xamppfiles/etc/ssl/client-key.pem';

That also did nothing to change mysql's ssl settings. I was just looking to connect to mysql in php using ssl. My php code looks like this below:

   error_reporting(E_ALL);
   ini_set("display_errors", "1");
   $link = mysqli_init();
   mysqli_ssl_set($link,'/Applications/XAMPP/xamppfiles/etc/ssl/server-key.pem','/Applications/XAMPP/xamppfiles/etc/ssl/server-cert.pem','/Applications/XAMPP/xamppfiles/etc/ssl/ca-cert.pem',null, null);
   mysqli_real_connect($link,$dbhost, $dbuser, $dbpass, $dbname);

I can't connect with the code above it gives me a ssl error. Is there anyone that can help me set this up so that i can use ssl please?



Solution 1:[1]

The MySQL in XAMPP is actually a MardiaDB binary version. That version does not support SSL (TSL).

Try this: How can I change MariaDB to MySQL in XAMPP?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 siph