Skip to content

Distributing OpenVPN Connect profiles to fleets

How we deliver OpenVPN Connect (OVPN3) profiles to client devices at scale — server-locked profiles, one-time link patterns, MDM integration, and the operational rules we follow.

OpenVPN Connect is the official OpenVPN client (macOS, Windows, iOS, Android, ChromeOS). It speaks the standard .ovpn format but adds a “server-locked” variant that pulls config and credentials live from the gateway, plus tighter MDM integration. This article covers the distribution patterns we use: server-locked profiles for fleet deployments, one-time download links for ad-hoc roadwarriors, MDM push for managed devices, and the operational rules that keep profile sprawl from becoming an incident.

How to verify

Before issuing a profile, confirm the gateway hostname resolves, the server cert matches the hostname clients dial, and the version of OpenVPN Connect users have installed supports your config directives.

dig +short vpn.example.org
openssl s_client -connect vpn.example.org:443 -servername vpn.example.org </dev/null 2>/dev/null | \
  openssl x509 -noout -subject -ext subjectAltName -dates

If you are using OpenVPN Access Server, the profile flow is different from a self-built OpenVPN community-edition server. Access Server emits server-locked profiles natively; community-edition emits user-locked .ovpn files unless you build the server-locked wrapper yourself.

What’s happening

There are three profile shapes you will hand to OpenVPN Connect:

  1. User-locked .ovpn — a standard config file with <ca>, <cert>, <key> blocks inlined. The user imports it, never enters credentials again. Revoke by CRL.
  2. Server-locked profile — a small bootstrap config pointing at a profile-server URL. The client logs in (username/password, MFA, SSO) and pulls the real config + ephemeral credentials live. Revoke by disabling the user.
  3. Auto-login profile — the user’s credentials are baked in; the client connects without prompting. Only used for headless / IoT devices where there is no human to enter a password.

The distribution problem is identical for all three: how do you get a sensitive file from your server to a user’s device without leaking it, and how do you revoke it when the user leaves?

Our default is server-locked profiles with SSO. The bootstrap config is non-sensitive (it identifies the gateway, not the user); the live credentials never sit on disk in plain form.

The procedure

  1. For OpenVPN Access Server, server-locked is the default. Generate the bootstrap profile from the admin UI (“User Permissions” -> user -> “Get Connection Profile”) or via the API:

    curl -k -u admin:admin-pass \
      "https://vpn.example.org:943/rpc/GetUserlogin?user=alice&serverLocked=true" \
      -o alice.ovpn
  2. For self-built community-edition OpenVPN, wrap a standard .ovpn with a script that fetches from a one-time link. We host a small Go service behind Caddy that generates 24-hour links signed with HMAC; the user clicks the link, OpenVPN Connect imports the profile, and the link burns.

    # Caddy snippet
    vpn-portal.example.org {
        reverse_proxy 127.0.0.1:8082
    }
  3. Push via MDM for managed devices. Jamf, Intune, Kandji, Workspace ONE, Google MDM — all support distributing .mobileconfig (iOS/macOS) and similar profile types (Android/Windows) with OpenVPN Connect settings embedded. The settings include vpn-profile-data (the base64-encoded .ovpn) and per-app VPN scope.

    For iOS/macOS, a sample .mobileconfig payload structure:

    <key>VPNType</key><string>VPN</string>
    <key>VPNSubType</key><string>net.openvpn.connect.app</string>
    <key>VPN</key>
    <dict>
      <key>AuthenticationMethod</key><string>Password</string>
      <key>RemoteAddress</key><string>vpn.example.org</string>
      <key>ProviderType</key><string>app-proxy</string>
      <key>VendorConfig</key>
      <dict>
        <key>ovpn</key><data>BASE64_ENCODED_OVPN</data>
      </dict>
    </dict>
  4. Never email the .ovpn file directly. It contains the user’s private key (in user-locked form) or credentials (in auto-login form). Use one-time links, chat DMs with retention controls, or MDM push exclusively.

  5. Track every issuance. Even when distribution is automated, log (user, profile_id, issued_at, channel, expires_at, revoked_at) into a ledger. When auditors ask “who has VPN access today,” you read the ledger, not your inbox.

  6. Revoke through identity, not files. With server-locked profiles + SSO, deactivating the user in the IdP is sufficient — the next renew fails and existing tunnels are killed at the gateway’s session timeout. With user-locked profiles, you regenerate the CRL on the gateway:

    cd /etc/openvpn/easy-rsa
    ./easyrsa --batch revoke alice
    ./easyrsa gen-crl
    install -m 644 pki/crl.pem /etc/openvpn/server/crl.pem
    systemctl reload openvpn-server@server
  7. Confirm revocation worked. Watch the gateway logs the next time the user tries to connect:

    journalctl -u openvpn-server@server -f | grep -E 'TLS Error|VERIFY ERROR|crl'

Operational notes

  • Server-locked profiles need a profile-server endpoint to be reachable. If your VPN gateway is also your profile server, an outage on the VPN side blocks new sessions even when existing tunnels would still work.
  • OpenVPN Connect on iOS/Android does not accept profiles via Files app drag-and-drop reliably; use the share-sheet “Open in OpenVPN” flow or MDM push.
  • The version of OpenVPN Connect installed determines which data-ciphers are accepted. Force a baseline of ChaCha20-Poly1305 + AES-256-GCM and reject legacy CBC.
  • Profile sprawl is the slow killer. After 18 months we routinely see fleets where 30% of issued profiles map to users who no longer exist. Quarterly review against the IdP roster catches this.
  • For per-app VPN scope on iOS/Android, you must use the MDM-pushed profile flow. Manual import does not give the OS the policy hook for app-level VPN.

In the engagements we run, OpenVPN Connect distribution is one piece of a managed identity perimeter — the profiles are an output of the IdP + ticketing pipeline, not a manual artifact. That is the kind of work Managed Operations absorbs: not just “we issue a profile,” but “we issue a profile that an auditor can trace back to a request, a user, and a revocation date.”