I created server.crt
, server.key
and root.crt
files on Centos 7 and put the same onto the C:\Users\xxxx\AppData\Roaming\postgresql
folder in windows as i am running the postgresql server on windows. Now on running my applications using SSL, i am getting the error as
"The host name could not be verified"
Any help please.
A host name verifier ensures the host name in the URL to which the client connects matches the host name in the digital certificate that the server sends back as part of the SSL connection.
Click the name of the server for which you want to disable host name verification. Select Configuration > SSL , and click Advanced at the bottom of the page. Set the Hostname Verification field to None.
Using SSL, you can encrypt a PostgreSQL connection between your applications and your PostgreSQL DB instances. By default, RDS for PostgreSQL uses and expects all clients to connect using SSL/TLS, but you can also require it. RDS for PostgreSQL supports Transport Layer Security (TLS) versions 1.1 and 1.2.
I am using JetBrains Data Grip to access Postgres dbs on Heroku, and got the same error in the latest JDBC driver version. That's how I solved it (using answers provided here).
Set the following in the Advanced tab:
ssl=true
sslmode=require
sslfactory=org.postgresql.ssl.NonValidatingFactory
(I updated sslmode
value from verify-ca
to required
because it works with Heroku Postgres now)
If you don't care about hostname verification while still wanting to use a certificate, you can use the additional parameter sslmode=verify-ca
as a connection parameter or as part of the URL to disable hostname verification while retaining certificate verification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With