Please help with the following problem ...
OS - Windows. I want to configure SSL on Postgresql 12. Then my Java application will add entries to the database, delete, etc.
I created certificates: CA, server, client. CA and server are located in the directory C:\Program Files\PostgreSQL\12\data The client is located in C:\Users\User\AppData\postgresql Then I added CA certificate to trusted in Windows.
Configs:
pg_hba:
hostnossl all all 0.0.0.0/0 reject
hostssl all all 0.0.0.0/0 cert clientcert=1
postgresql.conf:
ssl = on
ssl_ca_file = 'root.crt'
I can connect server throw pgAdmin with my certificates, but there are some errors in cmd (and java) Thant's what I tried to do in cmd
psql.exe -U postgres -h 127.0.0.1
Result: SSL: certificate verify failed FATAL: pg_hba.conf rejects connection for host "127.0.0.1", user "postgres", database "prod", SSL off
Logs: tlsv1 alert unknown ca FATAL: pg_hba.conf rejects connection for host "127.0.0.1", user "postgres", database "prod", SSL off
Please, tell me what's can be wrong and how can I fix it...
Also I did not find information, how to transfer my certificates to the database from Java application. Maybe, anybody can help me with that problem))
Thanks!