From a54421dd976fd8081e96c11c2621076876c9986b Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Tue, 17 Feb 2026 11:07:37 +0100 Subject: Replace CLI arguments with config-file parser and add integration tests Introduce a reusable key=value config parser (config.h/c) and convert all three programs to read their settings from config files instead of positional command-line arguments. Add example config files in config/ and 6 CTest integration tests covering None/Basic256Sha256/Aes128 with anonymous and user authentication. Remove the now-obsolete launch.sh. --- config/server_register.conf | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 config/server_register.conf (limited to 'config/server_register.conf') diff --git a/config/server_register.conf b/config/server_register.conf new file mode 100644 index 0000000..3c905a5 --- /dev/null +++ b/config/server_register.conf @@ -0,0 +1,47 @@ +# ServerRegister configuration +# +# Keys: +# port Server port number +# applicationUri OPC UA application URI +# serverCertificate Path to server certificate (.der) +# serverPrivateKey Path to server private key (.der) +# clientCertificate Path to client certificate for LDS connection (.der) +# clientPrivateKey Path to client private key for LDS connection (.der) +# discoveryEndpoint LDS endpoint URL (e.g. opc.tcp://localhost:4840) +# registerInterval Seconds between re-registrations with the LDS +# securityMode None, Sign, or SignAndEncrypt +# securityPolicy None, Basic256Sha256, Aes256_Sha256_RsaPss, +# Aes128_Sha256_RsaOaep, or ECC_nistP256 +# serverAuthMode Auth mode for clients connecting to this server: +# "anonymous" or "user" +# serverUsername Username (required when serverAuthMode = user) +# serverPassword Password (required when serverAuthMode = user) +# clientAuthMode Auth mode for connecting to the LDS: +# "anonymous" or "user" +# clientUsername Username (required when clientAuthMode = user) +# clientPassword Password (required when clientAuthMode = user) +# trustList Trusted certificate path (repeat for multiple) + +port = 4841 +applicationUri = urn:bobink.ServerRegister +serverCertificate = certs/ServerRegister_cert.der +serverPrivateKey = certs/ServerRegister_key.der +clientCertificate = certs/ServerRegisterClient_cert.der +clientPrivateKey = certs/ServerRegisterClient_key.der + +discoveryEndpoint = opc.tcp://localhost:4840 +registerInterval = 10 + +securityMode = SignAndEncrypt +securityPolicy = Aes128_Sha256_RsaOaep + +serverAuthMode = user +serverUsername = user +serverPassword = password + +clientAuthMode = user +clientUsername = user +clientPassword = password + +trustList = certs/ServerLDS_cert.der +trustList = certs/ClientFindServers_cert.der -- cgit v1.2.3