Commit 4cba1f6b authored by Magnus Hagander's avatar Magnus Hagander

Show SSL encryption information when logging connections

Expand the messages when log_connections is enabled to include the
fact that SSL is used and the SSL cipher information.

Dr. Andreas Kunert, review by Marko Kreen
parent 9c14dd22
......@@ -230,14 +230,32 @@ PerformAuthentication(Port *port)
if (Log_connections)
{
if (am_walsender)
{
#ifdef USE_SSL
if (port->ssl)
ereport(LOG,
(errmsg("replication connection authorized: user=%s SSL(protocol: %s, cipher: %s) enabled",
port->user_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
else
#endif
ereport(LOG,
(errmsg("replication connection authorized: user=%s",
port->user_name)));
}
else
{
#ifdef USE_SSL
if (port->ssl)
ereport(LOG,
(errmsg("connection authorized: user=%s database=%s SSL(protocol: %s, cipher: %s) enabled",
port->user_name, port->database_name, SSL_get_version(port->ssl), SSL_get_cipher(port->ssl))));
else
#endif
ereport(LOG,
(errmsg("connection authorized: user=%s database=%s",
port->user_name, port->database_name)));
}
}
set_ps_display("startup", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment