X-dea / flutter_vpn

Plugin to access VPN service for Flutter | Flutter 的 VPN 插件
GNU Lesser General Public License v3.0
345 stars 125 forks source link

Issue Connecting VPN in iOS #106

Closed arshmancodes closed 1 year ago

arshmancodes commented 1 year ago

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 commented 1 year ago

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 commented 10 months ago

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

arshmancodes commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

Sure.

liangguohun commented 7 months ago

@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 commented 7 months ago

@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 commented 7 months ago

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

arshmancodes commented 6 months ago

@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 commented 6 months ago

@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 https://github.com/nizwar/openvpn_flutter/issues/86 and also follow this medium profile If you like 😊 https://medium.com/@syedabdulbasit7