mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Revert changes for SSL compression in libpq
This partially reverts096bbf7
and9d2d457
, undoing the libpq changes as it could cause breakages in distributions that share one single libpq version across multiple major versions of Postgres for extensions and applications linking to that. Note that the backend is unchanged here, and it still disables SSL compression while simplifying the underlying catalogs that tracked if compression was enabled or not for a SSL connection. Per discussion with Tom Lane and Daniel Gustafsson. Discussion: https://postgr.es/m/YEbq15JKJwIX+S6m@paquier.xyz
This commit is contained in:
@ -1257,8 +1257,13 @@ initialize_SSL(PGconn *conn)
|
||||
if (have_rootcert)
|
||||
SSL_set_verify(conn->ssl, SSL_VERIFY_PEER, verify_cb);
|
||||
|
||||
/* disable SSL compression */
|
||||
SSL_set_options(conn->ssl, SSL_OP_NO_COMPRESSION);
|
||||
/*
|
||||
* 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);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1548,12 +1553,8 @@ 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 "off";
|
||||
return SSL_get_current_compression(conn->ssl) ? "on" : "off";
|
||||
|
||||
if (strcmp(attribute_name, "protocol") == 0)
|
||||
return SSL_get_version(conn->ssl);
|
||||
|
Reference in New Issue
Block a user