Skip to main content

Using Mobileconfig Profiles

You can create OpenVPN profiles using the iPhone Configuration Utility (iPCU) and export them to a .mobileconfig file, which you can import into one or more iOS devices. Unfortunately, the process is cumbersome because you must manually enter the directives of the OpenVPN profile as key/value pairs into the iPCU.

  1. Open iPCU.

  2. Tap File.

  3. Select "New Configuration Profile".

  4. Edit the newly created Configuration Profile.

  5. Click General in the left pane.

  6. Fill out the fields such as Name, Identifier, Organization, etc.

  7. Click on VPN in the left pane.

    • A "Configure VPN" dialog box should appear in the main window.

  8. Click Configure.

  9. Fill out the VPN settings as described below:

    1. Connection Name should be set to a name that will identify this profile on the device.

    2. Connection Type should be set to Custom SSL.

    3. Identifier should be set to "net.openvpn.connect.app". (On older versions, this used to be net.openvpn.OpenVPN-Connect.vpnplugin.)

    4. Server must be set to "DEFAULT". The actual server hostname will be configured via OpenVPN remote directives in the Custom Data section.

    5. User Authentication should be set to Password, and the password field should be left blank.

You must define parameters normally given in the OpenVPN client configuration file using key/value pairs in the Custom Data section:

  • Define each OpenVPN directive as a key, with arguments specified as the value. As in the OpenVPN configuration file, arguments are space-delimited and may be quoted.

  • Key value pairs for remotecacertkeytls-authkey-directionauth-user-passcomp-lzocipherauthns-cert-typeremote-cert-tls must be defined if the server requires them.

  • If your server doesn't require clients to authenticate with a client certificate and private key, you can omit key/value pairs for ca and cert, but be sure to add the key/value pair "setenv" : "CLIENT_CERT 0".

  • The client certificate and private key can be separately imported onto the iOS device using a PKCS#12 file, in which case you can omit key/value pairs for ca and cert.

  • If you are attaching a private key to the configuration using the key directive, consider encrypting the key with a password to protect it while in transit to the target iOS device.

  • You must add a special key/value pair "vpn-on-demand" : "0" so that OpenVPN can distinguish this profile from an iOS VPN-On-Demand profile.

  • Use "NOARGS" as the value for OpenVPN directives with no arguments.

  • If multiple instances of the same directive are present when entering the directive as a key, number the directives in the order they should be given to OpenVPN by appending .n to the directive, where n is an integer, such as remote.1 or remote.2.

  • For multi-line directives such as ca, cert, key, and tls-auth, where the argument is a multi-line file, an escaping model is provided to specify the file content as a single-line value. The procedure is to convert the multi-line data to a single line by replacing line breaks with "\n" (without the quotes). Note that because of this escaping model, you must use "\\" to pass the backslash itself.

  • For OpenVPN Access Server meta-directives such as "OVPN_ACCESS_SERVER_USERNAME", remove the OVPN_ACCESS_SERVER_ prefix, giving USERNAME as the directive.

Once you’ve defined the profile, you have two options for exporting it to an iOS device:

  1. If your device is currently tethered, click on your device name in the left pane. Then in the main window, click on the Configuration Profiles tab. You should see the name of your Configuration Profile and a button to install it on the device.

  2. You can also save the Configuration Profile as a .mobileconfig file and make it available to iOS clients via email or the web. To do this, select your Configuration Profile, go to the File menu, and select "Export...". An Export Configuration Profile dialog box will appear. Select a Security option — "Sign configuration profile" is a reasonable choice. Press the Export button and save the profile.

When an iOS device receives an OpenVPN .mobileconfig profile (via Mail attachment, Safari download, or pushed by iPCU), it raises a dialog box to facilitate its import. After import, the profile is visible in OpenVPN.

For a sample Provisioning Profile without .p12 payload, please visit this page.