diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-17 19:06:22 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-17 19:06:22 +0100 |
| commit | 827e90e0daabe32e058e08dd2a253425898a7e7a (patch) | |
| tree | ecd3f31da63890ac029b7929eade88f38e078b3d /src/server_lds.c | |
| parent | e4ba24b3d24fdce36bc9dbd3c2c8f00b0ec23335 (diff) | |
| download | BobinkCOpcUa-827e90e0daabe32e058e08dd2a253425898a7e7a.tar.gz BobinkCOpcUa-827e90e0daabe32e058e08dd2a253425898a7e7a.zip | |
Replace ClientFindServers with unified Client, use trust store directories
Replace the single-purpose ClientFindServers program with a unified Client
that supports three operations via CLI: find-servers, get-endpoints, and
read-time. This simplifies the architecture by using one client binary with
a single config file instead of a monolithic program that did everything in
one run.
Split the ServerRegister config into separate server and client config files
so the LDS-registration credentials are isolated from the server's own
settings. The discovery URL moves from config to a CLI argument.
Replace repeated trustList config entries with a single trustStore directory
path. Each program now points to a directory under certs/trust/ containing
.der files, so adding or removing trust is a file-copy operation rather than
editing every config file. Add loadTrustStore()/freeTrustStore() to
common.c and remove the now-unused configGetAll() from the config parser.
Simplify the test matrix from 6 to 4 cases (security and auth are
orthogonal, so the full 3x2 matrix is unnecessary). Update run_test.sh to
invoke the new Client three times and use port-polling instead of sleep.
Diffstat (limited to 'src/server_lds.c')
| -rw-r--r-- | src/server_lds.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server_lds.c b/src/server_lds.c index 2fe508f..a9a68bc 100644 --- a/src/server_lds.c +++ b/src/server_lds.c @@ -111,9 +111,20 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } + const char *trustStore = configRequire (&cfg, "trustStore", "ServerLDS"); + if (!trustStore) + { + configFree (&cfg); + return EXIT_FAILURE; + } + char **trustPaths = NULL; size_t trustSize = 0; - configGetAll (&cfg, "trustList", &trustPaths, &trustSize); + if (loadTrustStore (trustStore, &trustPaths, &trustSize) != 0) + { + configFree (&cfg); + return EXIT_FAILURE; + } UA_StatusCode retval; UA_Server *server @@ -121,7 +132,7 @@ main (int argc, char *argv[]) trustPaths, trustSize, &retval); if (!server) { - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return EXIT_FAILURE; } @@ -147,7 +158,7 @@ main (int argc, char *argv[]) if (retval != UA_STATUSCODE_GOOD) { UA_Server_delete (server); - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return EXIT_FAILURE; } @@ -164,7 +175,7 @@ main (int argc, char *argv[]) retval = UA_Server_run (server, &running); UA_Server_delete (server); - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; } |
