create a tunnel in “ WIREGUARD ” version 1.0.12

I'm trying to create tunnel using wireguard in ios but it always shows the same error on activating the tunnel that config is invalid.
1. Code=1 "Missing protocol or protocol has invalid type" wireguard
2. Error saving tunnel after re-enabling: Error Domain=NEVPNErrorDomain Code=1 "Missing protocol or protocol has invalid type"


Im giving these paramters when create a tunnel from scratch
Name, Pri-Pub auto generated, Addresses, Listen Port, In Add Peer section => Public Key and save the tunnel

P.S. I created tunnel with same configs on wireguard application that was downloaded from app store. But the same version is giving error in xcode
Answered by DTS Engineer in 660234022

I have been testing app in xcode cloned from github.

So you’re building the whole app from source, including the embedded NE provider? If so, you must have had to change the bundle IDs because both the app and the NE provider use entitlements that must be allowlisted by your provisioning profile, and your provisioning profile is tied to your App ID, and App IDs are team specific. Given that, the problem is most likely related to that bundle ID change. Look over that change and make sure that:
  • You got all instances of both bundle IDs, including those used in code (like providerBundleIdentifier).

  • The NE provider bundle ID is a ‘child’ of the app bundle ID.

If the product uses App Groups, you’ll have to do the same process for its group IDs as well.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I’m not sure I understand what you’re trying to do here, so let me start by clarifying that. From reading your post it seems like you’ve:
  1. Downloaded the WireGuard app to your iOS device.

  2. Are then running your own app on the device.

  3. And that app is trying to create a WireGuard configuration using NETunnelProviderManager (or perhaps its superclass NEVPNManager).

Is that right?

If so, that won’t work. VPN apps can only work with configurations that they ‘own’. In the case of a packet tunnel provider, only the container app can create configurations (or see configurations imported by a configuration profile).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I have been testing app in xcode cloned from github. Application is running fine but when I try to create a tunnel it gives me error as I mentioned. Do I have to add something to add my own config?

Accepted Answer

I have been testing app in xcode cloned from github.

So you’re building the whole app from source, including the embedded NE provider? If so, you must have had to change the bundle IDs because both the app and the NE provider use entitlements that must be allowlisted by your provisioning profile, and your provisioning profile is tied to your App ID, and App IDs are team specific. Given that, the problem is most likely related to that bundle ID change. Look over that change and make sure that:
  • You got all instances of both bundle IDs, including those used in code (like providerBundleIdentifier).

  • The NE provider bundle ID is a ‘child’ of the app bundle ID.

If the product uses App Groups, you’ll have to do the same process for its group IDs as well.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I have added my own bundle identifiers believing it will work but at the end same error.

I have added my own bundle identifiers believing it will work but at
the end same error.

Do you still have the original app installed? If so, remove that, just to make sure that you’re not being affect by some sort of cross talk.

Beyond that, it’s hard to say because there’s a raft of third-party code between you and the NE APIs. If you believe that this third-party code is working then issues with changing the bundle ID are the most likely cause of this problem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

@bilalmughal While creating a new vpn using the wireguard integrated to the app, how did you initialize the tunnel manager. Or could you provide the steps you followed while creating one in your app using wireguard

create a tunnel in “ WIREGUARD ” version 1.0.12
 
 
Q