0

I'm trying to connect InvoiceNinja to my MariaDB database using SSL.

The client server (InvoiceNinja) can connect to the database server via command line without an issue:

mysql -u Username -h Hostname -p

When I use the InvoiceNinja GUI via /setup, I am able to test the database connection okay, but after submitting the page, I end up in a setup loop.

Enabling the debug to true, outputs this:

[2022-07-23 22:34:41] production.INFO: account table not found  
[2022-07-23 22:35:25] production.INFO: The command "mysql --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.
Exit Code: 1(General error)
Working directory: /var/www/ninja/public
Output:
================
Error Output:
================
ERROR 2026 (HY000): SSL connection error: Permission denied

I edited the config/database.php file to include the following under 'mysql':

        'options'        => [
            PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true,
            PDO::MYSQL_ATTR_SSL_KEY => '/var/www/ninja/db-certs/ninja.key',
            PDO::MYSQL_ATTR_SSL_CERT => '/var/www/ninja/db-certs/ninja.pem',
            PDO::MYSQL_ATTR_SSL_CA => '/var/www/ninja/db-certs/ca.pem',
        ],

I've also ran:

php artisan optimize
holdmydev
  • 109
  • 9

1 Answers1

0

After removing the entire ninja directory and downloading a fresh file, everything worked. Its possible that previous attempts started to load data and could not be overwritten. I'm not 100% sure, but everything I had configured was correct.

Hope this helps someone.

holdmydev
  • 109
  • 9