Problem connecting to remote MySQL via SSL

Problem connecting to remote MySQL via SSL

xpreflectxpreflect Posts: 1Questions: 0Answers: 0

Hello,

First of all, thank you all for taking the time to read my post and thank you to the DataTables team for the great product they develop! Keep up the good work!

Now I will dare to expose my problem...

I am trying to connect to a remote MySQL database via SSL.

I have followed the instructions in this post: https://datatables.net/forums/discussion/43533

The connection attempt was made as follows:

$sql_details = array(
    "type" => "Mysql",
    "user" => "testUser",
    "pass" => "testPass",
    "host" => "testURL.mysql.database.azure.com",
    "port" => "3306",
    "db" => "testDB",
    "dsn" => "charset=utf8",
    "pdoAttr" => array(
        PDO::MYSQL_ATTR_SSL_KEY    =>'BaltimoreCyberTrustRoot.crt.pem',
        PDO::MYSQL_ATTR_SSL_CERT=>'BaltimoreCyberTrustRoot.crt.pem',
        PDO::MYSQL_ATTR_SSL_CA    =>'BaltimoreCyberTrustRoot.crt.pem'
    )
);

The pem certificate file is located in the same folder with the config.php file.

However, when trying to fetch the table, I am receiving the following error:

:8080/php/table.modules.php?_=1573840034790:1 Failed to load resource: net::ERR_EMPTY_RESPONSE

Could ypu please give me some directions to start debugging this?

Thank you very much!

Replies

  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin

    Could you try:

            PDO::MYSQL_ATTR_SSL_KEY    => __DIR__ .'/BaltimoreCyberTrustRoot.crt.pem',
            PDO::MYSQL_ATTR_SSL_CERT=>__DIR__ .'/BaltimoreCyberTrustRoot.crt.pem',
            PDO::MYSQL_ATTR_SSL_CA    => __DIR__ .'/BaltimoreCyberTrustRoot.crt.pem'
    

    I'm wondering if it was trying to include the files from the path where the host PHP file is executed.

    Allan

This discussion has been closed.