@@ -2316,13 +2316,25 @@ pg_dumpall -p 5432 | psql -d postgres -p 5433
23162316 (<acronym>CA</acronym>s) you trust in a file in the data
23172317 directory, set the parameter <xref linkend="guc-ssl-ca-file"/> in
23182318 <filename>postgresql.conf</filename> to the new file name, and add the
2319- authentication option <literal>clientcert=1</literal> to the appropriate
2319+ authentication option <literal>clientcert=verify-ca</literal> or
2320+ <literal>clientcert=verify-full</literal> to the appropriate
23202321 <literal>hostssl</literal> line(s) in <filename>pg_hba.conf</filename>.
23212322 A certificate will then be requested from the client during SSL
23222323 connection startup. (See <xref linkend="libpq-ssl"/> for a description
2323- of how to set up certificates on the client.) The server will
2324- verify that the client's certificate is signed by one of the trusted
2325- certificate authorities.
2324+ of how to set up certificates on the client.)
2325+ </para>
2326+
2327+ <para>
2328+ For a <literal>hostssl</literal> entry with
2329+ <literal>clientcert=verify-ca</literal>, the server will verify
2330+ that the client's certificate is signed by one of the trusted
2331+ certificate authorities. If <literal>clientcert=verify-full</literal>
2332+ is specified, the server will not only verify the certificate
2333+ chain, but it will also check whether the username or its mapping
2334+ matches the <literal>cn</literal> (Common Name) of the provided certificate.
2335+ Note that certificate chain validation is always ensured when the
2336+ <literal>cert</literal> authentication method is used
2337+ (see <xref linkend="auth-cert"/>).
23262338 </para>
23272339
23282340 <para>
@@ -2341,18 +2353,34 @@ pg_dumpall -p 5432 | psql -d postgres -p 5433
23412353 The <literal>clientcert</literal> authentication option is available for
23422354 all authentication methods, but only in <filename>pg_hba.conf</filename> lines
23432355 specified as <literal>hostssl</literal>. When <literal>clientcert</literal> is
2344- not specified or is set to 0, the server will still verify any presented
2345- client certificates against its CA file, if one is configured — but
2346- it will not insist that a client certificate be presented.
2356+ not specified or is set to <literal>no-verify</literal>, the server will still
2357+ verify any presented client certificates against its CA file, if one is
2358+ configured — but it will not insist that a client certificate be presented.
2359+ </para>
2360+
2361+ <para>
2362+ There are two approaches to enforce that users provide a certificate during login.
2363+ </para>
2364+
2365+ <para>
2366+ The first approach makes use of the <literal>cert</literal> authentication
2367+ method for <literal>hostssl</literal> entries in <filename>pg_hba.conf</filename>,
2368+ such that the certificate itself is used for authentication while also
2369+ providing ssl connection security. See <xref linkend="auth-cert"/> for details.
2370+ (It is not necessary to specify any <literal>clientcert</literal> options
2371+ explicitly when using the <literal>cert</literal> authentication method.)
2372+ In this case, the <literal>cn</literal> (Common Name) provided in
2373+ the certificate is checked against the user name or an applicable mapping.
23472374 </para>
23482375
23492376 <para>
2350- If you are setting up client certificates, you may wish to use
2351- the <literal>cert</literal> authentication method, so that the certificates
2352- control user authentication as well as providing connection security.
2353- See <xref linkend="auth-cert"/> for details. (It is not necessary to
2354- specify <literal>clientcert=1</literal> explicitly when using
2355- the <literal>cert</literal> authentication method.)
2377+ The second approach combines any authentication method for <literal>hostssl</literal>
2378+ entries with the verification of client certificates by setting the
2379+ <literal>clientcert</literal> authentication option to <literal>verify-ca</literal>
2380+ or <literal>verify-full</literal>. The former option only enforces that
2381+ the certificate is valid, while the latter also ensures that the
2382+ <literal>cn</literal> (Common Name) in the certificate matches
2383+ the user name or an applicable mapping.
23562384 </para>
23572385 </sect2>
23582386
0 commit comments