aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_find_servers.c
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-17 03:23:19 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-17 03:23:19 +0100
commit1bbf7e6c2ff571b2e26b643a7e86e35790b91875 (patch)
treef455073490071b96cc45f7db4898fcd8e6431a8e /src/client_find_servers.c
parentc35eb35bb63a97b7c46e879819757a9cb48165b5 (diff)
downloadBobinkCOpcUa-1bbf7e6c2ff571b2e26b643a7e86e35790b91875.tar.gz
BobinkCOpcUa-1bbf7e6c2ff571b2e26b643a7e86e35790b91875.zip
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.
Diffstat (limited to 'src/client_find_servers.c')
-rw-r--r--src/client_find_servers.c3
1 files changed, 2 insertions, 1 deletions
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)
{