Hi there!
This seems to be an older thread, but 'cause I was forced with the same problem ("how to use the Per-App VPN feature of iOS with an OpenVPN Server) and I finally got the solution (after a looong research :geek: 😛), I'd like to explain, how I got this to work:
Per-App VPN offers two "modes" (according to:
https://developer.apple.com/library/content/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010206-CH1-SW1) for a VPN-tunnel (search the page for "vpn dictonary keys":
- ProviderType: packet-tunnel
ProviderType: app-proxy
Well, the second one ist the default one if you do not explicit specify this optional key. And this default one DOES NOT WORK when you connect with "Per-App VPN" to an OpenVPN Server. To make it work, you have to explicit set the "ProviderType" to "packet-tunnel". You do this, by ediing the .mobilefonfig file you deploy to the phones via your MDM solution. Add the following lines whithin the "VPN Dictionary" and deploy it to your phones again. Afterwords "Per-App VPN" works like a charm 🙂
<key>ProviderType</key>
<string>packet-tunnel</string>
The whole "VPN Dictionray" within the .mobileconfig file may look something like this (among all the other stuff inside the file - I don't know how familiar you are with .mobileconfig files):
<key>VPN</key>
<dict>
<key>AuthenticationMethod</key>
<string>Certificate</string>
<key>AuthName</key>
<string>The user name</string>
<key>RemoteAddress</key>
<string>The remoteadress (IP or url)</string>
<key>PayloadCertificateUUID</key>
<string>UUID of a certificate</string>
<key>OnDemandEnabled</key>
<integer>1</integer>
<key>ProviderType</key>
<string>packet-tunnel</string>
</dict>
In my case (I use Sophos Mobile Control) the configuration GUI for "Per-App VPN" settings does not allow to select between the two modes - it useses the default option ("app-proxy") and therefore the deployed configuration does not work. I allways have to manually edit the configuration file and redeploy it to the phones. But I will raise this problem to Sophos and ask them to add possibility to select between the two options within the GUI.
Hope I could help you with my answer
Cheers!
Buscho