Connection to PostgreSQL Using Certificate: Wrong Permissions on Private Key File

From: "Atkins-Trimnell, Angus Black" <trimnell(at)uic(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Connection to PostgreSQL Using Certificate: Wrong Permissions on Private Key File
Date: 2008-03-29 18:05:29
Message-ID: 2542.75.22.200.105.1206813929.squirrel@webmail.uic.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hello,

I am having trouble connecting to PostgreSQL 8.2 from an Apache2 web
server using certificates.

I have set up a CA on my server and used it to sign a certificate
(server.crt) created in a signing request based on a private key
(server.key), both of which reside in my PostgreSQL data directory. I
have also made a copy of the CA certificate file as root.crt, which I have
placed in the data directory so that PostgreSQL can check the certificate
coming from the web server.

The home directory of the web server contains a subdirectory .postgresql
in which I have placed a private key (postgresql.key) and a certificate
(postgresql.crt), based on the key, that was signed by the CA.

I have tried various owner/group/permissions combinations for
WEB_HOME/.postgresql/postgresql.key. I have had it set as root:root with
700 permissions, postgresql:root with 700, and postgresql:postgresql with
700. I've also tried these various combinations with 750 permissions.

Regardless, when I try to connect, I get the following error message:

Unable to connect to PostgreSQL server: private key file
"/var/www/.postgresql/postgresql.key" has wrong permissions

Is there something obvious that I am doing wrong? I've tried to stick as
closely to the documentation as I could.

Thanks.

--Angus Atkins-Trimnell

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-03-29 19:41:47 Re: suggested wording improvement in psql
Previous Message Magnus Hagander 2008-03-29 18:01:21 Re: GSoC Proposal: PL/Mono

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-03-29 19:50:20 Re: Connection to PostgreSQL Using Certificate: Wrong Permissions on Private Key File
Previous Message Tom Lane 2008-03-29 17:50:10 Re: Third thoughts about the DISTINCT MAX() problem