tls: fix server log messages to have client IP address

Add an additional parameter to TLS_CreateInstance() to save the label of
the connection (server name on the client side and client IP
address:port on the server side) instead of the server name (which is
NULL on the server side) to fix the log messages.

Fixes: 3e32e7e694 ("tls: move gnutls code into tls_gnutls.c")
This commit is contained in:
Miroslav Lichvar
2025-08-06 15:43:41 +02:00
parent abc267a556
commit 93a78c73ad
3 changed files with 13 additions and 16 deletions

View File

@@ -613,7 +613,7 @@ NKSN_StartSession(NKSN_Instance inst, int sock_fd, const char *label,
assert(inst->state == KE_STOPPED);
inst->tls_session = TLS_CreateInstance(inst->server, sock_fd, inst->server_name,
NKE_ALPN_NAME, credentials,
label, NKE_ALPN_NAME, credentials,
clock_updates < CNF_GetNoCertTimeCheck());
if (!inst->tls_session)
return 0;