1

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?

Aaron Holland
  • 13
  • 1
  • 3
  • are you trying to setup a phpmyadmin that connect to a local db where user access thru ssl on the fronend? if that is the case, configure you apache instead. there is nothing to do with php layer – You Qi Jun 01 '12 at 02:44
  • my apache is configured to use ssl already. I want to encrypt mysql connections with ssl. – Aaron Holland Jun 01 '12 at 02:53

1 Answers1

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?

siph
  • 11
  • 2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Tyler2P Feb 27 '22 at 08:33
  • Alright, thnx for info – siph Feb 27 '22 at 09:22