Setting min/max TLS protocol in clientside libpq - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Setting min/max TLS protocol in clientside libpq
Date
Msg-id 4F246AE3-A7AE-471E-BD3D-C799D3748E03@yesql.se
Whole thread Raw
Responses Re: Setting min/max TLS protocol in clientside libpq  (Arthur Zakirov <zaartur@gmail.com>)
List pgsql-hackers
Responding to the recent thread on bumping the default TLS version, I realized
that we don't have a way to set the minimum/maximum TLS protocol version in
clientside libpq.  Setting the maximum protocol version obviously not terribly
important (possibly with the exception of misbehaving middle-boxes and
testing), but the minimum version can be quite useful to avoid misbehaving
and/or misconfigured servers etc.

The attached patch implements two new connection string variables for minimum
and maximum TLS protocol version, mimicking how it's done in the backend.  This
does duplicate a bit of code from be-secure-openssl.c to cope with older
versions of OpenSSL, but it seemed a too trivial duplication to create
common/openssl.c (but others might disagree).

This can today be achieved by editing the local openssl configuration, but
having an override in libpq to tighten down the connection parameters make it
far easier for the user/application IMO.

cheers ./daniel


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bogus EXPLAIN results with column aliases for mismatched partitions
Next
From: David Nedrow
Date:
Subject: Re: [PATCH] Addition of JetBrains project directory to .gitignore