element-hq / element-hq/element-x-android

Not all server requests use ALPN correctly

Open
#6,728 9 comments 0 reactions 0 assignees View on GitHub
O-Uncommon S-Major T-Defect X-Needs-Rust
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

### Steps to reproduce

I am trying to migrate from the old Element (Classic) app to the new Element X app. I have my own homeserver, but I need to multiplex two services onto port 443, one of which is the HTTPS server for Synapse. I use ALPN to distinguish between the services, where http1.1 and h2 direct to the Synapse server. This is necessary since I have to access my server navigating through corporate firewalls that limit access to port 443 only. There is no way around this requirement.

#### Steps to reproduce:

1. Set up a Synapse server
2. Set up nginx with a config that uses ALPN pre-read to channel requests that come with h2 or http/1.1 onto the Synapse server port
3. Attempt to connect to server with Element X app on Android

### Outcome

#### What did you expect?
I expect that I can connect to my Synapse server.

#### What happened instead?
I got an error saying that it could not connect to the server.

The old Element (Classic) app correctly used ALPN in all requests and therefore worked perfectly. The new Element X app uses ALPN sometimes but not all the time. If I change my nginx configuration to direct traffic without an ALPN identifier onto Synapse then the app works. In this way I can see that some but not all messages include an ALPN identifier. However, I cannot keep this state.

Please can I request that the Element X app supports ALPN fully like the old app did so that I can migrate to the new app? This is what is preventing migration.

### Your phone model

Samsung SM-S921B

### Operating system version

Android 16

### Application version and app store

26.04.4

### Homeserver

Synapse 1.139.0

### Will you send logs?

No

### Are you willing to provide a PR?

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.