SimpleTunnel Sample Code: PacketTunnel Entitlement Issue

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>
...

The issue was caused by the used iOS device running 12.5.1. Using a iOS 14.x device fixes the described issue. It still can not connect sucessfully but that is a new issue.

Sorry for the noise and for talking to myself. (I do not understand why that is though)

SimpleTunnel Sample Code: PacketTunnel Entitlement Issue
 
 
Q