Secure connection

QuestionsSecure connection
Matt asked 4 years ago

How would I setup my database config.php file to use a secure connection from the grid to the MySQL server please? Referencing a .crt.pem file.

2 Answers
Abu Ghufran Staff answered 4 years ago

Hi,

I researched on your question but the database library wrapper we are currently using (php-adodb) does not support ssl database connection settings.

The change in core library is doable but it will break with the future changes.

You can change lib/inc/adodb/drivers/adodb-mysqli.inc.php

On line 112 before mysqli_real_connect, you can call: mysqli_ssl_set as in https://stackoverflow.com/questions/23342604/cant-connect-with-pdo-using-ssl-but-mysqli-with-ssl-works

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Matt answered 4 years ago

Perfect, thanks! This was the key to getting it to work.

examples,

//mysqli
$conn=mysqli_init();
mysqli_ssl_set($conn, $clientkey, $clientcert, $sharedca, NULL, NULL);
if (!mysqli_real_connect($conn, $host, $user, $pass, $db))
{
    die("Failed connecting to ssl mysql via mysqli");
}

Also, the php formatting example here:

https://docs.microsoft.com/en-us/azure/mysql/howto-configure-ssl

 

Your Answer

11 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?