MXS-3051: Show connection TLS cipher

This tells the user whether a session is using TLS or not. Currently, only
the client TLS cipher is shown in MaxCtrl as the backend ciphers require
additional formatting.
This commit is contained in:
Markus Mäkelä 2020-08-28 12:16:17 +03:00
parent ebdb9655e6
commit 63a050bd7a
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499
3 changed files with 16 additions and 1 deletions

View File

@ -208,6 +208,11 @@ const session_fields = [
path: 'attributes.idle',
description: 'How long the session has been idle, in seconds'
},
{
name: 'Client TLS Cipher',
path: 'attributes.client.cipher',
description: 'Client TLS cipher'
},
{
name: 'Connections',
path: 'attributes.connections[].server',

View File

@ -3866,7 +3866,16 @@ json_t* dcb_to_json(DCB* dcb)
char buf[25];
snprintf(buf, sizeof(buf), "%p", dcb);
json_object_set_new(obj, "id", json_string(buf));
json_object_set_new(obj, "server", json_string(dcb->server->name));
if (dcb->server)
{
json_object_set_new(obj, "server", json_string(dcb->server->name));
}
if (dcb->ssl)
{
json_object_set_new(obj, "cipher", json_string(SSL_get_cipher_name(dcb->ssl)));
}
if (dcb->func.diagnostics_json)
{

View File

@ -876,6 +876,7 @@ json_t* session_json_data(const Session* session, const char* host)
}
json_object_set_new(attr, "connections", dcb_arr);
json_object_set_new(attr, "client", dcb_to_json(session->client_dcb));
json_t* queries = session->queries_as_json();
json_object_set_new(attr, "queries", queries);