Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Connecting VPN in iOS #106

Closed
arshmancodes opened this issue Oct 6, 2022 · 10 comments
Closed

Issue Connecting VPN in iOS #106

arshmancodes opened this issue Oct 6, 2022 · 10 comments

Comments

@arshmancodes
Copy link

Hello there, I Have developed a VPN Application and the application is working perfectly on Android all the servers added to the Application are connecting without any issue on Android.

But when I opened the project on Xcode and added Network Extension and Personal VPN Capability in the Target Runner.
And when I run the Application on iOS on Trying to connect the VPN I get a message in the Console "VPN Started Successfully"
But when I see the FlutterVPNState, it shows disconnected and the VPN Symbol doesn't appear on Top of the screen.

I tried many possible solutions and When I add a Network Extension to Target the application crashes and doesn't open up.

Can anyone share the possible solutions for this ?
I think there is an issue because the Package shows VPN Started Successfully but it doesn't and doesn't even give an error message.
Screenshot 2022-10-07 at 1 16 55 AM

@arshmancodes
Copy link
Author

arshmancodes commented Oct 9, 2022

Fixed, The flutter_VPN was not being able to catch the error because there was no issue in the Configuration.
Just updated some Algorithms like Integrity and Encryption Algorithm and it worked like a charm.

The configuration of the IKEV2 can differ for everyone so Everyone should update it accordingly.

Anyone having same issues can reach me out for further fixes.

p.ikeSecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithm.algorithmAES256GCM p.ikeSecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithm.SHA384 p.ikeSecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup.group20 p.childSecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithm.algorithmAES256GCM p.childSecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithm.SHA384 p.childSecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup.group20

@syedabdulbasit1
Copy link

@arshmancodes Please, would you like to share the code with me I am stuck in IOS configuration.

@arshmancodes
Copy link
Author

arshmancodes commented Oct 22, 2023

@syedabdulbasit1

I have provided the code above you can just open the XCode and paste the above lines of code in the Swift file natively.
It would work fine.
It also depends upon your IKEV2 Relay server.
You can drop me a message on any of my profiles on Github, if you still face any issues, i'll help you out.

@syedabdulbasit1
Copy link

@arshmancodes Thank you for your reply.
I already solved the issue and I am using this package https://pub.dev/packages/openvpn_flutter
If anything will go wrong I will message you. Thank you.

@arshmancodes
Copy link
Author

Sure.

@liangguohun
Copy link

@arshmancodes
could you tell me,
“The configuration of the IKEV2 can differ for everyone so Everyone should update it accordingly.”
where the file is and show the demo config step,please.

1 similar comment
@liangguohun
Copy link

@arshmancodes
could you tell me,
“The configuration of the IKEV2 can differ for everyone so Everyone should update it accordingly.”
where the file is and show the demo config step,please.

@liangguohun
Copy link

@syedabdulbasit1
I use https://pub.dev/packages/openvpn_flutter too, could you show me how to fix this problem.

@arshmancodes
Copy link
Author

@liangguohun

p.ikeSecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithm.algorithmAES256GCM p.ikeSecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithm.SHA384 p.ikeSecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup.group20 p.childSecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithm.algorithmAES256GCM p.childSecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithm.SHA384 p.childSecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup.group20

You can use the code above and paste it into the native swift implementation of the Plugin, if you are able to do the pod install and open the project in XCode, you will be able to see the package in the pods folder and navigate to its main file and there you will be able to see the functions and code of the package and then you can implement this code over there in the function.

If you need any more help or guidance feel free to contact me i will help you out with it.

@syedabdulbasit1
Copy link

@liangguohun
you don't need to copy paste above code I did it before configure above code in swift, you just need to check integration steps that is mention in https://pub.dev/packages/openvpn_flutter in this package and also check out this below link issue that is resolved
nizwar/openvpn_flutter#86
and also follow this medium profile If you like 😊
https://medium.com/@syedabdulbasit7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants