I have fetched the Apple Sample code for SimpleTunnel project and modified it to build and run under current Xcode and Swift 5.
I am trying to establish a VPN tunnel app<->tunnel_server using the default configurations (default config.plist, default "Demo VPN" setting in "PacketTunnel" section of app).
My issue is that PacketTunnel Network Extension get terminated due to not having suitable Entitlements, at least this is how I read the log in Console:
-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: CMSession: Client com.mycompany.com.example.apple-samplecode.SimpleTunnel.PacketTunnel with pid '3348' is now Terminated. Background entitlement: NO LongFormVideoApp: NO
I did follow this forum post to create appID and provisioning profile and I tripple checked I am using this profile for the "PacketTunnel" target.
Dumping the profile, that looks OK to me:
<key>Entitlements</key>
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>packet-tunnel-provider</string>
<string>dns-proxy</string>
<string>dns-settings</string>
</array>
...