Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set up server.crt, root.crt and servery.key in postgresql (using for instructions), set ssl = on and restarted the service successfully.

However, as I test the connection with psql to see if it's running in SSL I get the following

-bash-3.2$ psql -h localhost -U dbadmin
psql: could not open certificate file "/var/lib/pgsql/.postgresql/postgresql.crt": No such file or directory

I have the certificates stores in pgsql/data/, where they should be, so what's the disconnect between the top example and the following one?

psql ssl test documentation

share|improve this question

migrated from Mar 28 '11 at 3:42

This question came from our site for professional and enthusiast programmers.

Is this a test I would do on the client machine and not the server? I may have just answered my own question. – Angry Spartan Mar 24 '11 at 20:07

This is looking for the client certificate files. The server certificate files belong in pgsql/data/, as you correctly pointed out. The client certificate files are looked for in $HOME/.postgresql/. You are probably logged in as the postgres user, who happens to have a home directory of /var/lib/pgsql/, so that's how you got that path.

So either put the client certificate files where they are looked for, or log in as the correct user, or reconfigure the server so that it doesn't require client certificates.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.