Why is this happening?

ARTIFACTORY: How to overcome "org.postgresql.util.PSQLException: The hostname xxx.xxx.xxx.xxx could not be verified by hostnameverifier PgjdbcHostnameVerifier" exception while connecting the external PostgreSQL database to Artifactory?

AuthorFullName__c
Yuvarajan Johnpaul
articleNumber
000005219
ft:sourceType
Salesforce
FirstPublishedDate
2022-03-28T08:36:44Z
lastModifiedDate
2023-01-22T11:05:54Z
VersionNumber
2
As a security practice, the latest releases of the PostgreSQL databases use TLS encryption by default. At times, if the database is being accessed via the IP addresses, having failed to verify the secure connection established between Artifactory and Database, the server returns the below error.
YYYY-MM-DDT10:43:31.115Z [jfrt ] [ERROR] [8019426551caae4f] [c.z.h.p.HikariPool:593] [ocalhost-startStop-2] - HikariCP Main - Exception during pool initialization.
[...]
org.postgresql.util.PSQLException: The hostname xxx.xxx.xxx.xxx could not be verified by hostnameverifier PgjdbcHostnameVerifier.