mirror of
https://github.com/postgres/postgres.git
synced 2025-06-22 02:52:08 +03:00
Use abstracted SSL API in server connection log messages
The existing "connection authorized" server log messages used OpenSSL API calls directly, even though similar abstracted API calls exist. Change to use the latter instead. Change the function prototype for the functions that return the TLS version and the cipher to return const char * directly instead of copying into a buffer. That makes them slightly easier to use. Add bits= to the message. psql shows that, so we might as well show the same information on the client and server. Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@ -1047,22 +1047,22 @@ be_tls_get_compression(Port *port)
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
be_tls_get_version(Port *port, char *ptr, size_t len)
|
||||
const char *
|
||||
be_tls_get_version(Port *port)
|
||||
{
|
||||
if (port->ssl)
|
||||
strlcpy(ptr, SSL_get_version(port->ssl), len);
|
||||
return SSL_get_version(port->ssl);
|
||||
else
|
||||
ptr[0] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
be_tls_get_cipher(Port *port, char *ptr, size_t len)
|
||||
const char *
|
||||
be_tls_get_cipher(Port *port)
|
||||
{
|
||||
if (port->ssl)
|
||||
strlcpy(ptr, SSL_get_cipher(port->ssl), len);
|
||||
return SSL_get_cipher(port->ssl);
|
||||
else
|
||||
ptr[0] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user