settings to control SSL/TLS protocol version - Mailing list pgsql-hackers

From Peter Eisentraut
Subject settings to control SSL/TLS protocol version
Date
Msg-id 1822da87-b862-041a-9fc2-d0310c3da173@2ndquadrant.com
Whole thread Raw
Responses Re: settings to control SSL/TLS protocol version  (Daniel Gustafsson <daniel@yesql.se>)
Re: settings to control SSL/TLS protocol version  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
There have been some requests to be able to select the TLS versions
PostgreSQL is using.  We currently only hardcode that SSLv2 and SSLv3
are disabled, but there is also some interest now in disabling TLSv1.0
and TLSv1.1.  Also, I've had some issues in some combinations with the
new TLSv1.3, so there is perhaps also some use for disabling at the top end.

Attached is a patch that implements this.  For example:

    ssl_min_protocol_version = 'TLSv1'
    ssl_max_protocol_version = 'any'

For reference, here is similar functionality implemented elsewhere:

https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols
https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslprotocol

Unlike those two, which offer a list of protocols to use, I have gone
with min and max settings.  I think that is easier to use, and it also
maps better to the newer OpenSSL API (SSL_CTX_set_min_proto_version()
etc.).  The older SSL_CTX_set_options()-based approach is deprecated and
has some very weird behaviors that would make it complicated to use for
anything more than a min/max.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: has_column_privilege behavior (was Re: Assert failed insnprintf.c)
Next
From: Tom Lane
Date:
Subject: Re: SerializeParamList vs machines with strict alignment