strongswan: write local_key to swanctl.conf

The 'local_key' UCI option was validated (checked for existence
under /etc/swanctl/private/) but never written to the generated
'swanctl.conf'. As a result, setting 'local_key' had no actual effect
on which private key was used for local authentication.

Add the corresponding "privkeys" line to the local{} section,
mirroring how local_cert is already written as "certs", so that
swanctl explicitly uses the configured private key.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert authored and Florian Eckert committed 2026-08-03 11:07:41 +02:00
1 parent 6e6de6aff9
commit 4c58cafc7e
1 file changed
+2
+2
View File
@@ -553,6 +553,8 @@ config_remote() {
[ -n "$local_identifier" ] && swanctl_xappend3 "id = \"$local_identifier\""
[ "$local_auth_method" = pubkey ] && [ -n "$local_cert" ] && \
swanctl_xappend3 "certs = $local_cert"
[ "$local_auth_method" = pubkey ] && [ -n "$local_key" ] && \
swanctl_xappend3 "privkeys = $local_key"
swanctl_xappend2 "}"
swanctl_xappend2 "remote {"