#SSL Conection for Database Host

6 messages · Page 1 of 1 (latest)

earnest viper
#

Hello together,

I am experiencing an issue with SSL connections for the Database Host in Pterodactyl.

System setup:
Pterodactyl Panel is running on a separate server
MariaDB (latest version) is running on a dedicated database server
The connection between the panel and the database is secured via SSL
The standard database user (pterodactyl) can connect via SSL without any issues
The problem only occurs when adding a new Database Host in Pterodactyl
Problem description:
When trying to add a Database Host in Pterodactyl using pterodactyl_admin, the following error appears:

SQLSTATE[HY000] [1045] Access denied for user 'pterodactyl_admin'@'PANEL-IP' (using password: YES) (Connection: dynamic, SQL: SELECT 1 FROM dual)
Running php artisan migrate:status does not show any errors.

However, I can connect successfully using the same user and certificates via MySQL CLI:

mysql -u pterodactyl_admin -p -h DB-SERVER-IP
--ssl-ca=/etc/mysql/ssl/ca-cert.pem
--ssl-cert=/etc/mysql/ssl/client-cert.pem
--ssl-key=/etc/mysql/ssl/client-key.pem
This suggests that Pterodactyl is not correctly applying the SSL certificates for the Database Host.

Current configuration steps:
SSL is enabled in MariaDB (have_ssl=YES)
The user pterodactyl_admin is set to REQUIRE SSL
.env and database.php contain the correct SSL certificates for the standard database user
Pterodactyl can successfully connect as pterodactyl
The issue only occurs when adding a Database Host
Questions:
How can I make Pterodactyl use the SSL certificates for the Database Host (pterodactyl_admin) as well?
Is there a specific configuration in Pterodactyl to enforce SSL for Database Hosts?

meager dirgeBOT
#

🇫🇷 🥖 Bienvenue sur Internet, @earnest viper 🥖 🇫🇷

Your database is refusing the Panel's attempts to connect to it. This can be for a number of different reasons so I'll let a human double check, but here are some ideas.

  1. Is your MySQL instance running? systemctl status mysql(hopefully not down the road)
  2. Is the user you're trying to connect with authorized to access the given database from this IP address?
  3. Did you correctly give that user permission to even access that database?
  4. Do you have a Firewall that is blocking connections?
  5. Is your MySQL instance bound to 127.0.0.1 or localhost and you're trying to connect from outside the server?
  6. Does the user have GRANT permissions if you're trying to use them to create a new database for a server?
  7. Have special characters in your password? Make sure DB_PASSWORD in your .env file is enclosed in double quotes

Here is some additional documentation to help you out: https://pterodactyl.io/tutorials/mysql_setup.html

earnest viper
#

Everything is doublechecked. The problem is not the standard pterodactyl database user, it is the database host conneciton via ssl.

rustic delta
#

Don't use SSL, and instead panel-ip put %

earnest viper
#

Why not?For security it make sense to use SSL connection between database and panel. The standard pterodactyl user is able to use SSL, why is the Database Host not?

earnest viper
#

Does anyone have an idea?