OpenVPN 3 is a C++ library implementing a protocol-compatible OpenVPN client for secure VPN connectivity across multiple platforms.
OpenVPN 3 is a C++ class library that implements the functionality of an OpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.
OpenVPN 3 is used to build VPN client applications that enable secure network connections by tunneling traffic through encrypted channels. It is ideal for developers and organizations needing a robust, cross-platform VPN client library compatible with OpenVPN 2.x protocols, commonly used in mobile and desktop VPN clients.
OpenVPN 3 currently does not implement server functionality and is intended solely for client-side use. For optimal performance on Linux, enabling the ovpn kernel module (DCO) is recommended, especially on kernels 6.16 or newer. Users should ensure their OpenVPN config files have the .ovpn extension. Building on macOS requires Homebrew and proper OpenSSL path configuration. Running the client may require elevated privileges (sudo).
Install essential dependencies on Linux: ca-certificates, cmake, g++, git, iproute2, ninja-build, pkg-config
Install Linux additional dependencies: libasio-dev, libcap-dev, libfmt-dev, liblz4-dev, libjsoncpp-dev, libssl-dev, libxxhash-dev
Optionally install: libmbedtls-dev, liblzo2-dev, python3-dev, swig
Clone the repository: git clone https://github.com/OpenVPN/openvpn3.git
Create build directory and run cmake with Ninja generator
Build the project: cmake --build .
Run unit tests: ctest
To use mbedTLS instead of OpenSSL, run cmake with -DUSE_MBEDTLS=ON
For ovpn-dco support, install libnl-genl-3-dev
Build with ovpn-dco enabled: cmake -DCLI_OVPNDCO=ON .. && cmake --build .
sudo test/ovpncli/ovpncli myprofile.ovpn route-nopull
Run the OpenVPN 3 client with a specified OpenVPN config file and prevent SSH session lockout.
sudo test/ovpncli/ovpncli [--no-dco] myprofile.ovpn
Run the OpenVPN 3 client with optional disabling of data channel offload when using ovpn kernel module.
cmake -GNinja ..
Generate build files using Ninja generator.
cmake --build .
Build the OpenVPN 3 client and library.
ctest
Run unit tests to validate the build.
cmake -GNinja -DUSE_MBEDTLS=ON ..
Configure build to use mbedTLS cryptographic library instead of OpenSSL.