From 1bbf7e6c2ff571b2e26b643a7e86e35790b91875 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Tue, 17 Feb 2026 03:23:19 +0100 Subject: Add username/password authentication to servers and client Disallow anonymous sessions on both the LDS and registering server by configuring UA_AccessControl_default with a hardcoded user/password credential pair. Set UA_ClientConfig_setAuthenticationUsername on the client configs used for register, re-register, and deregister calls. Use UA_Client_connectUsername in the FindServers client when reading server time. --- src/client_find_servers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client_find_servers.c') diff --git a/src/client_find_servers.c b/src/client_find_servers.c index c62fc15..4789b38 100644 --- a/src/client_find_servers.c +++ b/src/client_find_servers.c @@ -160,7 +160,8 @@ readServerTime (UA_Client *client, UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_CLIENT, "Connecting to %s to read current time...", url); - UA_StatusCode retval = UA_Client_connect (client, url); + UA_StatusCode retval + = UA_Client_connectUsername (client, url, "user", "password"); UA_free (url); if (retval != UA_STATUSCODE_GOOD) { -- cgit v1.2.3