aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-17 22:30:28 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-17 22:44:44 +0100
commit229a536a87f6b2075000e659219e0567b45345c5 (patch)
tree2a69cb8e2117741fa0387dde8561c9fe22e92a72 /tools
parent381f5c8b480ccafad5b1ce3c3766229f3791cb51 (diff)
downloadBobinkCOpcUa-229a536a87f6b2075000e659219e0567b45345c5.tar.gz
BobinkCOpcUa-229a536a87f6b2075000e659219e0567b45345c5.zip
Update certificate generation: keep intermediate files, fix URI format
Stop deleting intermediate PEM and CNF files so they can be reused. Change default application URI from urn:bobink.<name> to urn:localhost:bobink:<name> to follow proper URN syntax (Qt OPC UA rejects the dotted format). Update all config files and test configs to use the new URI format.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/generate_certificate.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/generate_certificate.sh b/tools/generate_certificate.sh
index 81fe947..76f8a19 100755
--- a/tools/generate_certificate.sh
+++ b/tools/generate_certificate.sh
@@ -6,7 +6,7 @@
# Arguments:
# $1 certs_dir — output directory for generated files (created if missing)
# $2 name — identity name (e.g. "ServerLDS", "ClientFindServers")
-# $3 uri — (optional) application URI; defaults to urn:bobink.<name>
+# $3 uri — (optional) application URI; defaults to urn:localhost:bobink:<name>
#
# Produces:
# <certs_dir>/<name>_cert.der — DER-encoded X.509 certificate
@@ -23,7 +23,7 @@ fi
certs_dir="$1"
name="$2"
cn="${name}@localhost"
-uri="${3:-urn:bobink.${name}}"
+uri="${3:-urn:localhost:bobink:${name}}"
mkdir -p "$certs_dir"
@@ -58,9 +58,8 @@ openssl x509 -in "$certs_dir/${name}_cert.pem" -outform der \
openssl rsa -in "$certs_dir/${name}_key.pem" -outform der \
-out "$certs_dir/${name}_key.der" 2>/dev/null
-rm -f "$certs_dir/${name}_key.pem" "$cnf"
-
echo "Generated certificate '$name' (CN=$cn, URI=$uri):"
echo " $certs_dir/${name}_cert.der"
echo " $certs_dir/${name}_cert.pem"
echo " $certs_dir/${name}_key.der"
+echo " $certs_dir/${name}_key.pem"