]> granicus.if.org Git - postgresql/commitdiff
Include SSL compression status in psql banner and connection logging
authorMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 13:07:38 +0000 (15:07 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 13:12:13 +0000 (15:12 +0200)
Both the psql banner and the connection logging already included
SSL status, cipher and bitlength, this adds the information about
compression being on or off.

src/backend/utils/init/postinit.c
src/bin/psql/command.c

index ed936d7fad8f7b48425c031d6c7398ddee97cf98..28243ad58f98517025abe30134b7929077b703d0 100644 (file)
@@ -234,8 +234,9 @@ PerformAuthentication(Port *port)
 #ifdef USE_SSL
                        if (port->ssl)
                                ereport(LOG,
-                                               (errmsg("replication connection authorized: user=%s SSL enabled (protocol=%s, cipher=%s)",
-                                                               port->user_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
+                                               (errmsg("replication connection authorized: user=%s SSL enabled (protocol=%s, cipher=%s, compression=%s)",
+                                                               port->user_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl),
+                                                               SSL_get_current_compression(port->ssl) ? _("on") : _("off"))));
                        else
 #endif
                                ereport(LOG,
@@ -247,8 +248,9 @@ PerformAuthentication(Port *port)
 #ifdef USE_SSL
                        if (port->ssl)
                                ereport(LOG,
-                                               (errmsg("connection authorized: user=%s database=%s SSL enabled (protocol=%s, cipher=%s)",
-                                                               port->user_name, port->database_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
+                                               (errmsg("connection authorized: user=%s database=%s SSL enabled (protocol=%s, cipher=%s, compression=%s)",
+                                                               port->user_name, port->database_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl),
+                                                               SSL_get_current_compression(port->ssl) ? _("on") : _("off"))));
                        else
 #endif
                                ereport(LOG,
index cede72a5d6cc18d9eb282dbc5784c1b6db641eec..161de75b0acd873e3266126c67b9a10f76ecd386 100644 (file)
@@ -1800,8 +1800,9 @@ printSSLInfo(void)
                return;                                 /* no SSL */
 
        SSL_get_cipher_bits(ssl, &sslbits);
-       printf(_("SSL connection (protocol: %s, cipher: %s, bits: %d)\n"),
-                  SSL_get_version(ssl), SSL_get_cipher(ssl), sslbits);
+       printf(_("SSL connection (protocol: %s, cipher: %s, bits: %d, compression: %s)\n"),
+                  SSL_get_version(ssl), SSL_get_cipher(ssl), sslbits,
+                  SSL_get_current_compression(ssl) ? _("on") : _("off"));
 #else
 
        /*