KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

My Cloud Hosted Database Requires a CA CERT #1423

Closed Patrick Vermont opened this topic on on May 6, 2020 - 2 comments

Patrick Vermont commented on May 6, 2020

Hello,

I have just moved my db to a cloud hosted version of MariaDB and it requires that I supply a .PEM file to securely connect with them. Is there a way to use \koolreport\datasources\MySQLDataSource in this way? PHP supports it but it doesn't seem to be used in the code.

The error I receive is: Warning: mysqli::__construct(): (HY000/1045): Access without SSL denied in /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/vendor/koolreport/core/src/datasources/MySQLDataSource.php on line 101

KoolReport commented on May 6, 2020

You should use default PdoDataSource, you can create the connection like this:

function settings() {
    return [
        "dataSources"=>[
            "mydb"=>[
                "connectionString"=>"...",
                "usename"=>"...",
                "password"=>"...",
                "options"=>[
                    \PDO::MYSQL_ATTR_SSL_KEY    =>'/path/to/client-key.pem',
                    \PDO::MYSQL_ATTR_SSL_CERT=>'/path/to/client-cert.pem',
                    \PDO::MYSQL_ATTR_SSL_CA    =>'/path/to/ca-cert.pem'
                ]
            ]
        ]
    ];
}

Hope that helps.

Patrick Vermont commented on May 6, 2020

Thank you! It works.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

None