[Bug 60485] New: wininet: after a redirect to https on another host, later requests on the same connection handle go to that host on port 443 without TLS
http://bugs.winehq.org/show_bug.cgi?id=60485 Bug ID: 60485 Summary: wininet: after a redirect to https on another host, later requests on the same connection handle go to that host on port 443 without TLS Product: Wine Version: 11.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wininet Assignee: wine-bugs@list.winehq.org Reporter: ti.mue.1010109@gmail.com Target Milestone: --- Distribution: --- Created attachment 82332 --> http://bugs.winehq.org/attachment.cgi?id=82332 Test program When a request gets redirected (302) from http to https on a different host, HTTP_HandleRedirect writes the new host and port into the shared session (the InternetConnect handle), but INTERNET_FLAG_SECURE only goes on the redirected request. Every later HttpOpenRequest on the same connection handle then goes to the redirect's host on port 443 as plain HTTP (Host header "host:443"). An https server resets the connection, and the request fails with ERROR_INTERNET_CONNECTION_ABORTED (12030). Real-world case: TrackMania United Forever downloads custom skins through one InternetConnect handle to united.tm-exchange.com:80. That site redirects to https://tmuf.exchange/. Only the first skin per track arrives and all others fail, so the in-game signs stay blank. Same result with Proton (wine-11.0 based), reported there: https://github.com/ValveSoftware/Proton/issues/467#issuecomment-6109833098 Test program (attached, redirect_reuse.c): one InternetConnect to united.tm-exchange.com:80, then three GET requests through it. Each one answers 302 with Location: https://tmuf.exchange/... For comparison it then sends the same three with a new connection handle each time. The flags are the game's: INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_PRAGMA_NOCACHE. Build and run: i686-w64-mingw32-gcc -O2 -o redirect_reuse.exe redirect_reuse.c -lwininet wine redirect_reuse.exe Output with wine-11.19 (fresh prefix): A) one connection handle for all requests: /special/signpack/BD-Right_2.zip status 200, 96802 bytes (request Host: tmuf.exchange) /special/signpack/BD-Right-135.zip HttpSendRequest FAILED, error 12030 (request Host: tmuf.exchange:443) /special/signpack/BD-Slow.zip HttpSendRequest FAILED, error 12030 (request Host: tmuf.exchange:443) B) a new connection handle per request (control): /special/signpack/BD-Right_2.zip status 200, 96802 bytes (request Host: tmuf.exchange) /special/signpack/BD-Right-135.zip status 200, 96867 bytes (request Host: tmuf.exchange) /special/signpack/BD-Slow.zip status 200, 94027 bytes (request Host: tmuf.exchange) The +wininet trace (excerpt attached) shows the second request built for "tmuf.exchange:443" with "Host: tmuf.exchange:443" and no TLS. Then "read_line read failed 10054" follows. Code: dlls/wininet/http.c, HTTP_HandleRedirect, sets session->hostName and session->hostPort, but sets INTERNET_FLAG_SECURE only in request->hdr.dwFlags: https://gitlab.winehq.org/wine/wine/-/blob/wine-11.19/dlls/wininet/http.c#L4... Not tested on Windows. As far as I know the game downloads all skins there, so I'd expect native wininet to leave the connection handle's server alone on a redirect (or at least keep it consistent with the secure flag). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60485 --- Comment #1 from ti.mue.1010109@gmail.com --- Created attachment 82333 --> http://bugs.winehq.org/attachment.cgi?id=82333 +wininet trace excerpt (wine-11.19) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60485 Qwerty Chouskie <asdfghrbljzmkd@outlook.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |asdfghrbljzmkd@outlook.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60485 Tomashu <wine@tomashu.dev> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wine@tomashu.dev -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla