nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.99k stars 788 forks source link

[Bug]: Mac Client HTTP2 connection falls back to 1.1 on HTTP2-enabled server #5326

Open emign opened 1 year ago

emign commented 1 year ago

⚠️ Before submitting, please verify the following: ⚠️

Bug description

On a HTTP2 enabled server (frontend uses h2 protocol correctly), the Mac client only connects via HTTP1.1 even with environment variable correctly set:

❯ printenv | grep OWNCLOUD
OWNCLOUD_HTTP2_ENABLED=1

Steps to reproduce

  1. Do any kind of file operations locally and let them sync

Expected behavior

A HTTP2 Connection should be established

Which files are affected by this bug

all

Operating system

Mac OS

Which version of the operating system you are running.

Ventura 13.0

Package

Appimage

Nextcloud Server version

25.0.2

Nextcloud Desktop Client version

3.6.4

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

IP.ADD.RE.SS - Username [12/Jan/2023:09:43:23 +0000] "GET /ocs/v2.php/apps/user_status/api/v1/user_status?format=json HTTP/1.1" 200 4019 "-" "Mozilla/5.0 (Macintosh) mirall/3.6.4git (build 12826) (Nextcloud, osx-22.1.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
IP.ADD.RE.SS - Username [12/Jan/2023:09:43:23 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 304 3856 "-" "Mozilla/5.0 (Macintosh) mirall/3.6.4git (build 12826) (Nextcloud, osx-22.1.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
IP.ADD.RE.SS - Username [12/Jan/2023:09:43:23 +0000] "PROPFIND /remote.php/dav/files/Username/ HTTP/1.1" 207 4158 "-" "Mozilla/5.0 (Macintosh) mirall/3.6.4git (build 12826) (Nextcloud, osx-22.1.0 ClientArchitecture: arm64 OsArchitecture: arm64)"

Additional info

No response

emign commented 1 year ago

Might this just be a visual glitch in the server logs? When I connect via chrome to the frontend, chrome tells me, I have a http2 connection but the server logs shows all connections as http1.1:

SCR-20230112-kwx

192.168.1.190 - - [12/Jan/2023:14:04:16 +0000] "GET /avatar//88 HTTP/1.1" 302 1018 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
192.168.1.190 - - [12/Jan/2023:14:04:16 +0000] "GET /apps/dashboard/ HTTP/1.1" 200 12335 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
192.168.1.190 - - [12/Jan/2023:14:04:16 +0000] "GET /apps/theming/favicon/dashboard?v=2dfab160 HTTP/1.1" 200 91167 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
172.20.0.1 - - [12/Jan/2023:14:04:24 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 3834 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
jum commented 1 year ago

I can see the same problem, my access logs indicate that iOS clients and access via browser does indeed use HTTP/2, but any access from Macs does only use HTTP/1.1.

mgallien commented 1 year ago

are you sure you do not have a proxy in the middle ? another thing could you please test the changes in https://github.com/nextcloud/desktop/pull/5544 ? log should now provide a direct clue about usage of HTTP2

jum commented 1 year ago

I do have a proxy in front of nextcloud, and that is exactly where I am looking at the logs (I use Caddy for SSL certificates). I do not have a Linux desktop, so I cannot test the .appimage, though. I only have Mac desktops.

Am 23. März 2023 07:02:58 GMT-05:00 schrieb Matthieu Gallien @.***>:

are you sure you do not have a proxy in the middle ? another thing could you please test the changes in https://github.com/nextcloud/desktop/pull/5544 ? log should now provide a direct clue about usage of HTTP2

-- Reply to this email directly or view it on GitHub: https://github.com/nextcloud/desktop/issues/5326#issuecomment-1481071188 You are receiving this because you commented.

Message ID: @.***>

emign commented 1 year ago

I do use nginx proxy manager. But it should be configured correctly to use TLS encryption with the correct certificate.

NGINX proxy manager administers a letsencrypt certificate which is available for nextcloud's apache server via a docker bind.

Nginx PM forwards from my domain https://cloud.mydomain.com to https://nextcloud_app_1:443 (via a docker network) and it works as intended, because the webpage is served with https and http2:

image

But the log insists on http 1.1 connections for the desktop client

0) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
172.18.0.2 - - [23/Mar/2023:15:31:58 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 3813 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"
172.18.0.2 - Username [23/Mar/2023:15:32:00 +0000] "PROPFIND /remote.php/dav/files/Username/ HTTP/1.1" 207 4803 "-" "Mozilla/5.0 (Macintosh) mirall/3.7.4git (build 14240) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
172.18.0.2 - Username [23/Mar/2023:15:32:00 +0000] "PROPFIND /remote.php/dav/files/Username/FOLDER33 HTTP/1.1" 207 4935 "-" "Mozilla/5.0 (Macintosh) mirall/3.7.4git (build 14240) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
172.18.0.2 - Username [23/Mar/2023:15:32:00 +0000] "PROPFIND /remote.php/dav/files/Username/FOLDER33/51%FOLDER HTTP/1.1" 207 4862 "-" "Mozilla/5.0 (Macintosh) mirall/3.7.4git (build 14240) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
172.18.0.2 - Username [23/Mar/2023:15:32:00 +0000] "PROPFIND /remote.php/dav/files/Username/FOLDER33/51%FOLDER/02%20aText%20Sync HTTP/1.1" 207 4425 "-" "Mozilla/5.0 (Macintosh) mirall/3.7.4git (build 14240) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
172.18.0.2 - Username [23/Mar/2023:15:32:00 +0000] "PROPFIND /remote.php/dav/files/Username/FOLDER33/51%FOLDER/02%20aText%20Sync/com.trankynam.aText HTTP/1.1" 207 4477 "-" "Mozilla/5.0 (Macintosh) mirall/3.7.4git (build 14240) (Nextcloud, osx-22.3.0 ClientArchitecture: arm64 OsArchitecture: arm64)"
szaimen commented 1 year ago

I think http2 was at some point disabled by purpose because there were compatibility issues. See e.g. https://github.com/nextcloud/desktop/pull/1573

tessus commented 1 year ago

@szaimen that was 4 years ago, yet the client still doesn't do h2 by default. the devs always said it's a qt problem. I just can't believe that the qt devs haven't fixed the issue since 2017. 2017 was the first time I opened an nc client issue to ask for h2 support.

I gave up on h2 support about 3 years ago. I am still using an owncloud client Version 2.4.3 (build 10347), which does the h2 just fine - and I don't have to set an env var, which is a method on macOS that truly sucks (because you have to start the client via the terminal and can't start it at login).

emign commented 1 year ago

I am 99% sure that the NC client on Mac ignores the env variable for http2 anyways.

jum commented 1 year ago

Looking at my web server stats, I would believe Nextcloud is the one application I host that would benefit the most from the newer h2 or even h3 features. The web side is already doing that, the desktop clients would be great to have on board.