Have Delta Chat not bypass VPN on android 16

That Delta Chat always uses the VPN if it is enabled.

Expected behavior

Delta Chat always uses the VPN if it is active to ensure its users are protected the way they intended by using a VPN.

Actual behavior

Delta Chat bypasses the VPN.

Example Images

first image: Delta Chat fails to connect over a VPN endpoint at Hetzner when the system setting “block all connections not using VPN” is on (second image). tracepath works all the way, nine.testrun.org refuses the connection (os error 13). this is a seperate issue from the imho way more important one: delta chat bypasses the always-on VPN in this configuration if “block all connections not using VPN” is set to off. third image: “block all connections not using VPN” set to off. fourth image: in this configuration, when an app is not forced over the VPN, Delta Chat happily bypasses it and connects to nine.testrun.org.

I just tried with Orbot, and Delta Chat won’t connect until the VPN connects, even without “Block All Connections Not Using VPN”.

Do you have any other evidence that Delta Chat bypasses the VPN? I’m pretty sure we’re just using the default route.

This might be just a coincidence that it failed to connect at first but then managed to connect when you disabled that.

Note, however, that calls and WebXDC real-time channels do indeed bypass the VPN: P2P and proxy settings [don’t risk leaking IP]. But I don’t think that’s the case for the email server connections.

The VPN is connected.

Without the block all connection enabled, Delta Chat works.

With it enabled, it does not work.

I.e. when it is forced over the active VPN, i get this issue: Delta Chat fails to connect over a Hetzner VPN endpoint - #3 by a1285a2866c97eddca81

When the block all connections not over VPN is disabled, it just works.

Clearly there is some issue somewhere that prevents Delta Chat to connect when it forced to use the VPN, and not when it is not forced. It would amaze me if Android was messing this up only with Delta Chat only with this setting toggled to on but Delta Chat still using the VPN when the option is is toggled off.

If I for example, with the force on or off, visit h77ps://my1p.w7f/ it shows the VPN endpoints IP, so firefox is handling it correctly and just works in either scenario.

I am now home and can try to do some tcpdump of what the phone sends out.

This was btw Delta Chat 2.64.0 but is now 2.69.0 and the issue remains identical. This is Android 16 as well btw.

For the non-believers in my logic:

wireshark-confirm

You can clearly see the connection to the VPN being active, the VPN endpoint is 2.28..

Yet, with forcing over VPN not enabled, Delta Chat does a direct connection to the IP address of nine.testrun.org..

h77ps://my1p.w7f shows me that firefox with extra doing automatically does use the VPN and that it is active.

Why Delta Chat is not using the VPN when not forced is maybe due to the other issue I referenced where it fails to connect to nine. Perhaps when it fails to connect over a VPN that it is not forced to go over, it falls back to a direct connection?

If so, that is imho suboptimal behaviour.

I wrote an answer in another thread:

The problem was solved by reinstalling so it is not clear if this is what happened, but the problem is reproducible by adding DC to the list of exceptions inside the Bitmask app.

We’'l never know after reinstalling bitmask as you asked me to privately.
It does bring up the question of: is there technically a way DC can see there is a VPN but it is not going over it, to be able to warn the user of that fact? I know it may be a bit outside the purview and scope of the project, but if this happens for whatever reason, the user may be far less safe in using DC than they are aware of.

I agree here. We can’t be adding a diagnostics tool for every problem a user might have with their device or third-party apps. If there is a simple way then maybe, but I doubt there is. At the very least this would require some UI.