]> granicus.if.org Git - postgresql/commitdiff
Disable ssl renegotiation by default.
authorAndres Freund <andres@anarazel.de>
Tue, 28 Jul 2015 19:50:11 +0000 (21:50 +0200)
committerAndres Freund <andres@anarazel.de>
Tue, 28 Jul 2015 20:06:32 +0000 (22:06 +0200)
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

doc/src/sgml/config.sgml
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample

index 179c60e46b99b688959726893feab6e60feda837..75877551d7ef6eb08fdb73ea2f731e2ea625b351 100644 (file)
@@ -674,7 +674,7 @@ SET ENABLE_SEQSCAN TO OFF;
         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>
@@ -686,6 +686,14 @@ SET ENABLE_SEQSCAN TO OFF;
          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>
 
index a66a7d9198c19cdd64319d703ccd4c7bfe067b67..a3e86223db702c56808ca67e24426c288534d9d7 100644 (file)
@@ -2291,7 +2291,7 @@ static struct config_int ConfigureNamesInt[] =
                        GUC_UNIT_KB,
                },
                &ssl_renegotiation_limit,
-               512 * 1024, 0, MAX_KILOBYTES,
+               0, 0, MAX_KILOBYTES,
                NULL, NULL, NULL
        },
 
index 82c8ae4a0c8a8d6eabc5d00f77a7557bafaaff67..40ea0f21f0ee0c441520ea57dae998327bf294f5 100644 (file)
@@ -80,7 +80,7 @@
 #ssl = off                             # (change requires restart)
 #ssl_ciphers = 'ALL:!ADH:!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
 #password_encryption = on
 #db_user_namespace = off