schwabe / ics-openvpn

OpenVPN for Android
3.36k stars 1.2k forks source link

OpenVPN connection fails until device is rebooted #1413

Closed yoopernc closed 2 years ago

yoopernc commented 2 years ago

General information

  1. Android Version: 10 (Q)
  2. Android Vendor/Custom ROM: Samsung
  3. Device: Galaxy S20
  4. Version of the app (version number/play store version/self-built): 0.7.28 (182)

Description of the issue

I create a Work Profile, install OpenVPN in the WP, store the VPN profile (below) using addNewVPNProfile(), test the connection using startProfile(UUID) (it connects), disconnect, and finish provisioning the Work Profile. The first attempt to connect using OpenVPN fails. I have added the OpenVPN logs of this failure. Once the device is rebooted, the connection to the VPN server connects and persists.

Profile

persist-tun
persist-key
dev tun
cipher AES-256-CBC
auth RSA-SHA256
tls-client
client
remote ***.**********.*** 1194
proto udp
nobind
remote-cert-tls server
redirect-gateway def1
dhcp-option DNS 8.8.8.8
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
206692e11cdcbb
...
-----END OpenVPN Static key V1-----
</tls-auth>
<ca>
-----BEGIN CERTIFICATE-----
MIIFCTCCAvGgAwIBAgIIVRBNx
...
-----END CERTIFICATE-----
</ca>
<cert>
...
</cert>
<key>
...
</key>

image

schwabe commented 2 years ago

please use full log to show if there is anything else. This log does not show why it disconnected. Only that it disconnected.

yoopernc commented 2 years ago

I turned the logging all the way up, and this is the content of the last screen:

screenshot-1637269205794

schwabe commented 2 years ago

Yeah that looks like something is triggering the disconnect since there is a SIGNAL SIGINT in that log. Normally that would be a user action.

yoopernc commented 2 years ago

Thanks for your reply. I can attest that no disconnect (or other user action) is taking place in this instance.

yoopernc commented 2 years ago

@schwabe Just a quick note to let you know that we are past this problem. Apparently, it was caused by something we were doing, and rebooting cleared it up. Now we can provision the Work Profile with VPN and immediately connect to the OpenVPN server.