@@ -8397,23 +8397,35 @@ ldap://ldap.acme.com/cn=dbserver,cn=hosts?pgconnectinfo?base?(objectclass=*)
8397
8397
<para>
8398
8398
If the server attempts to verify the identity of the
8399
8399
client by requesting the client's leaf certificate,
8400
- <application>libpq</application> will send the certificates stored in
8400
+ <application>libpq</application> will send the certificate(s) stored in
8401
8401
file <filename>~/.postgresql/postgresql.crt</filename> in the user's home
8402
8402
directory. The certificates must chain to the root certificate trusted
8403
8403
by the server. A matching
8404
8404
private key file <filename>~/.postgresql/postgresql.key</filename> must also
8405
- be present. The private
8406
- key file must not allow any access to world or group; achieve this by the
8407
- command <command>chmod 0600 ~/.postgresql/postgresql.key</command>.
8405
+ be present.
8408
8406
On Microsoft Windows these files are named
8409
8407
<filename>%APPDATA%\postgresql\postgresql.crt</filename> and
8410
- <filename>%APPDATA%\postgresql\postgresql.key</filename>, and there
8411
- is no special permissions check since the directory is presumed secure.
8408
+ <filename>%APPDATA%\postgresql\postgresql.key</filename>.
8412
8409
The location of the certificate and key files can be overridden by the
8413
- connection parameters <literal>sslcert</literal> and <literal>sslkey</literal> or the
8410
+ connection parameters <literal>sslcert</literal>
8411
+ and <literal>sslkey</literal>, or by the
8414
8412
environment variables <envar>PGSSLCERT</envar> and <envar>PGSSLKEY</envar>.
8415
8413
</para>
8416
8414
8415
+ <para>
8416
+ On Unix systems, the permissions on the private key file must disallow
8417
+ any access to world or group; achieve this by a command such as
8418
+ <command>chmod 0600 ~/.postgresql/postgresql.key</command>.
8419
+ Alternatively, the file can be owned by root and have group read access
8420
+ (that is, <literal>0640</literal> permissions). That setup is intended
8421
+ for installations where certificate and key files are managed by the
8422
+ operating system. The user of <application>libpq</application> should
8423
+ then be made a member of the group that has access to those certificate
8424
+ and key files. (On Microsoft Windows, there is no file permissions
8425
+ check, since the <filename>%APPDATA%\postgresql</filename> directory is
8426
+ presumed secure.)
8427
+ </para>
8428
+
8417
8429
<para>
8418
8430
The first certificate in <filename>postgresql.crt</filename> must be the
8419
8431
client's certificate because it must match the client's private key.
0 commit comments