aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-secure-openssl.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-03-09 11:16:47 +0900
committerMichael Paquier <michael@paquier.xyz>2021-03-09 11:16:47 +0900
commitf9264d1524baa19e4a0528f033681ef16f61b137 (patch)
tree846eccd93ae1cc4e88f72d8ceea447c1f71facc7 /src/interfaces/libpq/fe-secure-openssl.c
parentd4545dc19b8ea670bf62e06d22b0e4e6fcb45153 (diff)
downloadpostgresql-f9264d1524baa19e4a0528f033681ef16f61b137.tar.gz
postgresql-f9264d1524baa19e4a0528f033681ef16f61b137.zip
Remove support for SSL compression
PostgreSQL disabled compression as of e3bdb2d and the documentation recommends against using it since. Additionally, SSL compression has been disabled in OpenSSL since version 1.1.0, and was disabled in many distributions long before that. The most recent TLS version, TLSv1.3, disallows compression at the protocol level. This commit removes the feature itself, removing support for the libpq parameter sslcompression (parameter still listed for compatibility reasons with existing connection strings, just ignored), and removes the equivalent field in pg_stat_ssl and de facto PgBackendSSLStatus. Note that, on top of removing the ability to activate compression by configuration, compression is actively disabled in both frontend and backend to avoid overrides from local configurations. A TAP test is added for deprecated SSL parameters to check after backwards compatibility. Bump catalog version. Author: Daniel Gustafsson Reviewed-by: Peter Eisentraut, Magnus Hagander, Michael Paquier Discussion: https://postgr.es/m/7E384D48-11C5-441B-9EC3-F7DB1F8518F6@yesql.se
Diffstat (limited to 'src/interfaces/libpq/fe-secure-openssl.c')
-rw-r--r--src/interfaces/libpq/fe-secure-openssl.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 0fa10a23b4a..c88dd3a1183 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -1257,13 +1257,8 @@ initialize_SSL(PGconn *conn)
if (have_rootcert)
SSL_set_verify(conn->ssl, SSL_VERIFY_PEER, verify_cb);
- /*
- * Set compression option if necessary.
- */
- if (conn->sslcompression && conn->sslcompression[0] == '0')
- SSL_set_options(conn->ssl, SSL_OP_NO_COMPRESSION);
- else
- SSL_clear_options(conn->ssl, SSL_OP_NO_COMPRESSION);
+ /* disable SSL compression */
+ SSL_set_options(conn->ssl, SSL_OP_NO_COMPRESSION);
return 0;
}
@@ -1553,8 +1548,12 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
if (strcmp(attribute_name, "cipher") == 0)
return SSL_get_cipher(conn->ssl);
+ /*
+ * SSL compression is disabled, so even if connecting to an older server
+ * which still supports it, it will not be active.
+ */
if (strcmp(attribute_name, "compression") == 0)
- return SSL_get_current_compression(conn->ssl) ? "on" : "off";
+ return "off";
if (strcmp(attribute_name, "protocol") == 0)
return SSL_get_version(conn->ssl);