Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16412c7

Browse files
committed
Change libpq's default ssl_min_protocol_version to TLSv1.2.
When we initially created this parameter, in commit ff8ca5f, we left the default as "allow any protocol version" on grounds of backwards compatibility. However, that's inconsistent with the backend's default since b1abfec; protocol versions prior to 1.2 are not considered very secure; and OpenSSL has had TLSv1.2 support since 2012, so the number of PG servers that need a lesser minimum is probably quite small. On top of those things, it emerges that some popular distros (including Debian and RHEL) set MinProtocol=TLSv1.2 in openssl.cnf. Thus, far from having "allow any protocol version" behavior in practice, what we actually have as things stand is a platform-dependent lower limit. So, change our minds and set the min version to TLSv1.2. Anybody wanting to connect with a new libpq to a pre-2012 server can either set ssl_min_protocol_version=TLSv1 or accept the fallback to non-SSL. Back-patch to v13 where the aforementioned patches appeared. Patch by me, reviewed by Daniel Gustafsson Discussion: https://postgr.es/m/a9408304-4381-a5af-d259-e55d349ae4ce@2ndquadrant.com
1 parent 3b4b541 commit 16412c7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,9 +1745,9 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
17451745
<literal>TLSv1.1</literal>, <literal>TLSv1.2</literal> and
17461746
<literal>TLSv1.3</literal>. The supported protocols depend on the
17471747
version of <productname>OpenSSL</productname> used, older versions
1748-
not supporting the most modern protocol versions. If not set, this
1749-
parameter is ignored and the connection will use the minimum bound
1750-
defined by the backend.
1748+
not supporting the most modern protocol versions. If not specified,
1749+
the default is <literal>TLSv1.2</literal>, which satisfies industry
1750+
best practices as of this writing.
17511751
</para>
17521752
</listitem>
17531753
</varlistentry>

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
320320
"Require-Peer", "", 10,
321321
offsetof(struct pg_conn, requirepeer)},
322322

323-
{"ssl_min_protocol_version", "PGSSLMINPROTOCOLVERSION", NULL, NULL,
323+
{"ssl_min_protocol_version", "PGSSLMINPROTOCOLVERSION", "TLSv1.2", NULL,
324324
"SSL-Minimum-Protocol-Version", "", 8, /* sizeof("TLSv1.x") == 8 */
325325
offsetof(struct pg_conn, ssl_min_protocol_version)},
326326

0 commit comments

Comments
 (0)