Skip to content

add NetworkManager::import_ovpn() and OpenVpnBuilder::from_ovpn_file() #297

@cachebag

Description

@cachebag

part of #288. depends on the ovpn parser + cert store.

changes

add to OpenVpnBuilder:

pub fn from_ovpn_file(path: impl AsRef<Path>) -> Result<Self, ConnectionError>;
pub fn from_ovpn_str(content: &str, name: impl Into<String>) -> Result<Self, ConnectionError>;

parses the file, extracts inline certs (writing them via cert store), and pre-populates the builder. caller can override settings before .build().

add to NetworkManager:

pub async fn import_ovpn(
    &self,
    path: impl AsRef<Path>,
    username: Option<&str>,
    password: Option<&str>,
) -> Result<()>;

parses, creates the connection profile, and activates it.

tests

integration test: import a test .ovpn, verify NM connection profile has correct settings.

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