OpenVPNProvider

am using to NETunnelProvider in a openvpn client that is bridged in react-native but no luck there .. the connection to server keep disconnect every time.

  • the Network Extension is configurated.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSExtension</key>
	<dict>
		<key>NSExtensionPointIdentifier</key>
		<string>com.apple.networkextension.packet-tunnel</string>
		<key>NSExtensionPrincipalClass</key>
		<string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string>
	</dict>
</dict>
</plist>
  • typescript side is getting events from vpnStateObserver
connecting ...
Object {
  "message": "The VPN is in the process of connecting",
  "state": 1,
}
Object {
  "message": "The VPN is in the process of disconnecting",
  "state": 3,
}
Object {
  "message": "The VPN is disconnected",
  "state": 0,
}
tunel: 
    type = plugin
    identifier = xxxxxxxxx-6E77-47BA-B41C-52251D2D2C47
    serverAddress = x.x.x.x:1194
    identityDataImported = NO
    disconnectOnSleep = NO
    disconnectOnIdle = NO
    disconnectOnIdleTimeout = 0
    disconnectOnWake = NO
    disconnectOnWakeTimeout = 0
    includeAllNetworks = YES
    excludeLocalNetworks = NO
    enforceRoutes = NO
    authenticationMethod = 0
    reassertTimeout = 0
    providerConfiguration = {
        ovpn = {length = 8437, bytes = 0x636c6965 6e740a64 65762074 756e0a70 ... 732d6175 74683e0a }
    }
    providerBundleIdentifier = dev.***.xxxxxxx.vpn

To use NETunnelProvider the following entitlements must exists

com.apple.developer.networking.networkextension

configured with one of the following options

<key>com.apple.developer.networking.networkextension</key>
	<array>
		<string>app-proxy-provider</string>
		<string>content-filter-provider</string>
		<string>dns-proxy</string>
		<string>dns-settings</string>
		<string>packet-tunnel-provider</string>
	</array>

https://developer.apple.com/documentation/networkextension/netunnelprovider

OpenVPNProvider
 
 
Q