ARTIFACTORY: How to fix database ping failed error when having SSL on RDS database
Issue DescriptionDuring the setup of Artifactory with an SSL-enabled Database, an error may occur during Artifactory initialization, indicating a failure to establish a connection with the Database.
[TRACE] JDBC to PostgreSQL URL conversion: begin [INFO ] No ssl parameter found, falling back to sslmode=disable [TRACE] JDBC to PostgreSQL URL conversion: end Database ping failed with error pq: no pg_hba.conf entry for host "123.11.12.90", user "artifactory", database "artifactory", no encryption Database connection check failed <nil>
SolutionTo address this issue, you can assess the SSL status of the Database by executing the following query:
SHOW SSL;
This query will provide output indicating whether the SSL mode is set to 'on' or 'off' in the database.
When SSL mode is enabled, you should include sslmode='require' in the JDBC URL within the system.yaml file located at $JFROG_HOME/artifactory/var/etc/. This configuration allows Artifactory to establish a secure connection with the Database.
shared: database: type: postgresql driver: org.postgresql.Driver url: jdbc:postgresql://<your db url, for example:localhost:5432>/artifactory?sslmode=require username: artifactory password: password