1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

Disable ssl renegotiation by default.

While postgres' use of SSL renegotiation is a good idea in theory, it
turned out to not work well in practice. The specification and openssl's
implementation of it have lead to several security issues. Postgres' use
of renegotiation also had its share of bugs.

Additionally OpenSSL has a bunch of bugs around renegotiation, reported
and open for years, that regularly lead to connections breaking with
obscure error messages. We tried increasingly complex workarounds to get
around these bugs, but we didn't find anything complete.

Since these connection breakages often lead to hard to debug problems,
e.g. spuriously failing base backups and significant latency spikes when
synchronous replication is used, we have decided to change the default
setting for ssl renegotiation to 0 (disabled) in the released
backbranches and remove it entirely in 9.5 and master..

Author: Michael Paquier, with changes by me
Discussion: 20150624144148.GQ4797@alap3.anarazel.de
Backpatch: 9.0-9.4; 9.5 and master get a different patch
This commit is contained in:
Andres Freund 2015-07-28 21:39:40 +02:00
parent 03d7f3ba58
commit 48d23c72d3
3 changed files with 11 additions and 3 deletions

View File

@ -858,7 +858,7 @@ include 'filename'
cryptanalysis when large amounts of traffic can be examined, but it
also carries a large performance penalty. The sum of sent and received
traffic is used to check the limit. If this parameter is set to 0,
renegotiation is disabled. The default is <literal>512MB</>.
renegotiation is disabled. The default is <literal>0</>.
</para>
<note>
<para>
@ -870,6 +870,14 @@ include 'filename'
disabled.
</para>
</note>
<warning>
<para>
Due to bugs in <productname>OpenSSL</> enabling ssl renegotiation, by
configuring a non-zero <varname>ssl_renegotiation_limit</>, is likely
to lead to problems like long-lived connections breaking.
</para>
</warning>
</listitem>
</varlistentry>

View File

@ -2377,7 +2377,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_KB,
},
&ssl_renegotiation_limit,
512 * 1024, 0, MAX_KILOBYTES,
0, 0, MAX_KILOBYTES,
NULL, NULL, NULL
},

View File

@ -81,7 +81,7 @@
#ssl = off # (change requires restart)
#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
# (change requires restart)
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
#ssl_renegotiation_limit = 0 # amount of data between renegotiations
#ssl_cert_file = 'server.crt' # (change requires restart)
#ssl_key_file = 'server.key' # (change requires restart)
#ssl_ca_file = '' # (change requires restart)