nizwar / openvpn_flutter

A package that allow you to connect OpenVPN service with Flutter
https://pub.dev/packages/openvpn_flutter
GNU General Public License v3.0
85 stars 99 forks source link

Cannot connect to cert download from vpngate.net #122

Open Duchv2008 opened 1 month ago

Duchv2008 commented 1 month ago

My code connect success with my server. But when i change to ovpn cert download from vpngate.net

VPN lib not connect success.

I try test with open vpn client in macos. It ok with cert download from vpngate

Some log

I/flutter (13592): stage VPNStage.tcp_connect rawStage tcp_connect I/flutter (13592): stage VPNStage.wait_connection rawStage wait_connection I/flutter (13592): stage VPNStage.authenticating rawStage authenticating I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): stage VPNStage.get_config rawStage get_config I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): stage VPNStage.unknown rawStage reconnect I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): stage VPNStage.tcp_connect rawStage tcp_connect I/flutter (13592): stage VPNStage.wait_connection rawStage wait_connection I/flutter (13592): stage VPNStage.authenticating rawStage authenticating I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): stage VPNStage.get_config rawStage get_config I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0} I/flutter (13592): {connected_on: null, duration: 00:00:00, byte_in: 0, byte_out: 0, packets_in: 0, packets_out: 0}

Farg0k commented 1 month ago

try it add

data-ciphers AES-128-CBC
data-ciphers-fallback AES-128-CBC
dev-ali2 commented 1 month ago

try it add

data-ciphers AES-128-CBC
data-ciphers-fallback AES-128-CBC

Same problem, where to add it? in config file?

Farg0k commented 1 month ago

Yes. For me, it looks like this

if (config.contains('cipher AES-128-CBC') && !config.contains('data-ciphers')) {
      config = config.replaceAll('cipher AES-128-CBC', '''cipher AES-128-CBC
    data-ciphers 'AES-128-CBC'
    data-ciphers-fallback 'AES-128-CBC\'''');
    }
    if (config.contains('cipher AES-256-CBC') && !config.contains('data-ciphers')) {
      config = config.replaceAll('cipher AES-256-CBC', '''cipher AES-256-CBC
    data-ciphers 'AES-256-CBC'
    data-ciphers-fallback 'AES-256-CBC\'''');
    }