Skip to content

Commit 33e81fd

Browse files
committed
Note that sslmode=require verifies the CA if root cert is present
This mode still exists for backwards compatibility, making sslmode=require the same as sslmode=verify-ca when the file is present, but not causing an error when it isn't. Per bug 6189, reported by Srinivas Aji
1 parent 4c5d837 commit 33e81fd

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ PGconn *PQconnectdbParams(const char **keywords, const char **values, int expand
420420
<term><literal>require</literal></term>
421421
<listitem>
422422
<para>
423-
only try an <acronym>SSL</> connection
423+
only try an <acronym>SSL</> connection. If a root CA
424+
file is present, verify the certificate in the same way as
425+
if <literal>verify-ca</literal> was specified
424426
</para>
425427
</listitem>
426428
</varlistentry>
@@ -6732,6 +6734,18 @@ ldap://ldap.acme.com/cn=dbserver,cn=hosts?pgconnectinfo?base?(objectclass=*)
67326734
the connection parameters <literal>sslrootcert</> and <literal>sslcrl</>
67336735
or the environment variables <envar>PGSSLROOTCERT</> and <envar>PGSSLCRL</>.
67346736
</para>
6737+
6738+
<note>
6739+
<para>
6740+
For backwards compatibility with earlier versions of PostgreSQL, if a
6741+
root CA file exists, the behavior of
6742+
<literal>sslmode</literal>=<literal>require</literal> will be the same
6743+
as that of <literal>verify-ca</literal>, meaning the sever certificate
6744+
is validated against the CA. Relying on this behavior is discouraged,
6745+
and applications that need certificate validation should always use
6746+
<literal>validate-ca</literal> or <literal>validate-full</literal>.
6747+
</para>
6748+
</note>
67356749
</sect2>
67366750

67376751
<sect2 id="libpq-ssl-clientcert">

0 commit comments

Comments
 (0)