openvpn_flutter icon indicating copy to clipboard operation
openvpn_flutter copied to clipboard

OpenVPN Disconnects Instantly on Connection Attempt (Flutter)

Open RahimUllahAxlic opened this issue 10 months ago • 14 comments

I am using the openvpn_flutter package to implement VPN functionality in my Flutter app. The VPN connects and works perfectly on Android, but on iOS, it instantly disconnects as soon as I tap the connect button.

Steps to Reproduce: Configure OpenVPN using the openvpn_flutter package. Attempt to connect to a VPN server on iOS. The VPN connection initiates but immediately disconnects without any error message.

Expected Behavior: The VPN should establish a stable connection, similar to how it works on Android.

Actual Behavior: The VPN connection starts but disconnects instantly. No error message is displayed. The same configuration works fine on Android.

Environment Details: Flutter version: 3.24.4 openvpn_flutter version: 1.3.4 iOS Version: 18.2 Device: iPhone 14 Pro Max VPN Configuration: .ovpn

Troubleshooting Steps Tried: Verified that the .ovpn file is correctly formatted. Ensured correct app permissions Network Extensions, VPN Entitlements. Tested different VPN servers and configurations. Checked iOS logs for any errors → No issues found in logs. Tried the solution mentioned in this issue, which worked for someone with the same problem, but it did not work for me.

Additional Context: This issue does not occur on Android; VPN works as expected there. Any help or guidance would be appreciated!

Image this is the setting image of vpn

Image this is the xcode image

RahimUllahAxlic avatar Feb 20 '25 05:02 RahimUllahAxlic

@nizwar This issue is very urgent for me, and I need a solution by this weekend.

RahimUllahAxlic avatar Feb 20 '25 06:02 RahimUllahAxlic

Hi, kindly email me one of your server so i can have a look on this issue

nizwar avatar Feb 21 '25 10:02 nizwar

@nizwar i already sent email please overview

RahimUllahAxlic avatar Feb 25 '25 05:02 RahimUllahAxlic

@nizwar @RahimUllahAxlic did you find any solution? This appears to be on some devices. I am getting this issue in production and in debug. No error is show in console.

shafiquecbl avatar Feb 26 '25 11:02 shafiquecbl

me too facing the same issue kindly if reslove your issue guide us to

aiqalatif avatar Mar 03 '25 06:03 aiqalatif

@shafiquecbl No, I haven't found a solution yet. This issue seems to occur on certain devices, and I'm experiencing it in both production and debug modes. There's no error visible in the console. I'm still waiting for @nizwar response via email.

RahimUllahAxlic avatar Mar 03 '25 06:03 RahimUllahAxlic

okay

On Sun, 2 Mar 2025 at 22:31, Rahim Ullah @.***> wrote:

@shafiquecbl https://github.com/shafiquecbl No, I haven't found a solution yet. This issue seems to occur on certain devices, and I'm experiencing it in both production and debug modes. There's no error visible in the console. I'm still waiting for @nizwar https://github.com/nizwar response via email.

— Reply to this email directly, view it on GitHub https://github.com/nizwar/openvpn_flutter/issues/132#issuecomment-2693401316, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARU7AK2P7OCH7Z2Z2TV7FR32SPZNZAVCNFSM6AAAAABXP4T7NWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJTGQYDCMZRGY . You are receiving this because you commented.Message ID: @.***> [image: RahimUllahAxlic]RahimUllahAxlic left a comment (nizwar/openvpn_flutter#132) https://github.com/nizwar/openvpn_flutter/issues/132#issuecomment-2693401316

@shafiquecbl https://github.com/shafiquecbl No, I haven't found a solution yet. This issue seems to occur on certain devices, and I'm experiencing it in both production and debug modes. There's no error visible in the console. I'm still waiting for @nizwar https://github.com/nizwar response via email.

— Reply to this email directly, view it on GitHub https://github.com/nizwar/openvpn_flutter/issues/132#issuecomment-2693401316, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARU7AK2P7OCH7Z2Z2TV7FR32SPZNZAVCNFSM6AAAAABXP4T7NWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJTGQYDCMZRGY . You are receiving this because you commented.Message ID: @.***>

aiqalatif avatar Mar 03 '25 06:03 aiqalatif

@Nizwar, could you please allocate some time to look into this issue as well?

RahimUllahAxlic avatar Mar 03 '25 06:03 RahimUllahAxlic

@aiqalatif did you try https://github.com/nizwar/openvpn_flutter/issues/86 this?

RahimUllahAxlic avatar Mar 03 '25 07:03 RahimUllahAxlic

@nizwar @RahimUllahAxlic did you find any solution? This appears to be on some devices. I am getting this issue in production and in debug. No error is show in console.

which server do you use

aiqalatif avatar Mar 14 '25 06:03 aiqalatif

i am using multiple Servers like japan, Singapore and India. Why?

RahimUllahAxlic avatar Mar 20 '25 04:03 RahimUllahAxlic

no i mean openvpn you are using ? paid api ?

aiqalatif avatar Mar 20 '25 05:03 aiqalatif

I'm using openvpn_flutter, implementing VPN functionality. It works on Android but does not work on iOS. I press the Start button and it tries to connect and disconnects immediately. The connection should be established as with Android.

Environment Details: Flutter version: 3.24.0 iOS Version: 18.6.2 Device: iPhone 12 Mini

Verified that the .ovpn file is correctly formatted. Ensured correct app permissions Network Extensions, VPN Entitlements. Tested different VPN servers and configurations. Checked iOS logs for any errors → No issues found in logs. Tried the solution mentioned in this issue (https://github.com/nizwar/openvpn_flutter/issues/86), which worked for someone with the same problem, but it didn't work for me.

LOGS were added to the app to obtain information. I'll leave them below, they show the VPN status. Flutter: 🔴 [MAIN] Calling engine.connect() Flutter: 🔴 [MAIN] ✅ engine.connect() completed successfully Flutter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.connecting, raw=connecting Flutter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.disconnecting, raw=disconnecting Fltter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.disconnected, raw=disconnected

A screenshot of the device is attached. Was the problem that opened the current issue resolved?

Image

sandradeleenspace avatar Sep 30 '25 21:09 sandradeleenspace

I´m having the same problem @nizwar

I'm using openvpn_flutter, implementing VPN functionality. It works on Android but does not work on iOS. I press the Start button and it tries to connect and disconnects immediately. The connection should be established as with Android.

Environment Details: Flutter version: 3.24.0 iOS Version: 18.6.2 Device: iPhone 12 Mini

Verified that the .ovpn file is correctly formatted. Ensured correct app permissions Network Extensions, VPN Entitlements. Tested different VPN servers and configurations. Checked iOS logs for any errors → No issues found in logs. Tried the solution mentioned in this issue (#86), which worked for someone with the same problem, but it didn't work for me.

LOGS were added to the app to obtain information. I'll leave them below, they show the VPN status. Flutter: 🔴 [MAIN] Calling engine.connect() Flutter: 🔴 [MAIN] ✅ engine.connect() completed successfully Flutter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.connecting, raw=connecting Flutter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.disconnecting, raw=disconnecting Fltter: 🟡 [MAIN] onVpnStageChanged: data=VPNStage.disconnected, raw=disconnected

A screenshot of the device is attached. Was the problem that opened the current issue resolved?

Image

msosaleenspace avatar Oct 01 '25 19:10 msosaleenspace