Skip to content

Commit 444b2eb

Browse files
committed
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
1 parent f87bf84 commit 444b2eb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

doc/src/sgml/config.sgml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ SET ENABLE_SEQSCAN TO OFF;
670670
cryptanalysis when large amounts of traffic can be examined, but it
671671
also carries a large performance penalty. The sum of sent and received
672672
traffic is used to check the limit. If this parameter is set to 0,
673-
renegotiation is disabled. The default is <literal>512MB</>.
673+
renegotiation is disabled. The default is <literal>0</>.
674674
</para>
675675
<note>
676676
<para>
@@ -682,6 +682,14 @@ SET ENABLE_SEQSCAN TO OFF;
682682
disabled.
683683
</para>
684684
</note>
685+
686+
<warning>
687+
<para>
688+
Due to bugs in <productname>OpenSSL</> enabling ssl renegotiation, by
689+
configuring a non-zero <varname>ssl_renegotiation_limit</>, is likely
690+
to lead to problems like long-lived connections breaking.
691+
</para>
692+
</warning>
685693
</listitem>
686694
</varlistentry>
687695

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ static struct config_int ConfigureNamesInt[] =
20122012
GUC_UNIT_KB,
20132013
},
20142014
&ssl_renegotiation_limit,
2015-
512 * 1024, 0, MAX_KILOBYTES, NULL, NULL
2015+
0, 0, MAX_KILOBYTES, NULL, NULL
20162016
},
20172017

20182018
{

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
#ssl = off # (change requires restart)
8181
#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
8282
# (change requires restart)
83-
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
83+
#ssl_renegotiation_limit = 0 # amount of data between renegotiations
8484
#password_encryption = on
8585
#db_user_namespace = off
8686

0 commit comments

Comments
 (0)