Skip to content

build_openvpn_connection() — D-Bus settings construction #292

@cachebag

Description

@cachebag

part of #288. depends on OpenVpnConfig.

changes

add build_openvpn_connection(config, opts) in api/builders/openvpn_builder.rs. constructs the NM settings dict for openvpn connections:

connection.type = "vpn"
vpn.service-type = "org.freedesktop.NetworkManager.openvpn"
vpn.data = { connection-type, remote, port, proto-tcp, username, ca, cert, key, cipher, auth, tunnel-mtu, ... }
vpn.secrets = { password, cert-pass }
ipv4.method = "auto"   (server pushes config, unlike wireguard's "manual")
ipv6.method = "auto"

key difference from wireguard: openvpn uses the NM VPN plugin model with flat string dicts in vpn.data and vpn.secrets, not typed D-Bus properties.

tests

unit tests verifying correct keys/values in the output dict for each auth type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestnmrsChanges to nmrsvpnChanges to VPN surface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions