Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serveTLS: requests are not completed by the browser and time out #750

Closed
timonson opened this issue Feb 23, 2021 · 3 comments · Fixed by denoland/deno#10146
Closed

serveTLS: requests are not completed by the browser and time out #750

timonson opened this issue Feb 23, 2021 · 3 comments · Fixed by denoland/deno#10146
Assignees
Labels
bug Something isn't working

Comments

@timonson
Copy link
Contributor

timonson commented Feb 23, 2021

It is impossible to serve a website with serveTLS because some subsequent file requests originating from the html file are not completed.

I made a minimal reproduction consisting of an html and a gif file.

Run it with:

sudo deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts -p 443 -c /etc/letsencrypt/live/domain.com/fullchain.pem -k /etc/letsencrypt/live/domain.com/privkey.pem

It is important to mention that I tested it with different static file servers and the behavior is always the same: The browser will not finish loading the page.

This behavior only happens with deno versions 1.7.1 and higher. When you downgrade deno to 1.7.0 everything works like expected (besides that the server crashes after a few hours but that's another issue).

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="icon" href="data:," />
    <title>Bug</title>
  </head>
  <body tabindex="0">
    <img src="./drawkit-grape-pack-illustration-1-transcode.gif" alt="" />
  </body>
</html>

drawkit-grape-pack-illustration-1-transcode

@ry ry added the bug Something isn't working label Mar 10, 2021
@kt3k
Copy link
Member

kt3k commented Mar 22, 2021

I was able to reproduce this with 1.7.1 and above and also I confirmed this doesn't happen with 1.7.0. (The above gif stops animating in first a few frames in 3 browsers (chrome, firefox, safari). Firefox reports "Image corrupt or truncated.")

ref: The list of commits between 2 versions: denoland/deno@v1.7.0...v1.7.1

piscisaureus added a commit to piscisaureus/deno that referenced this issue May 10, 2021
…ite half"

using tokio::io::split() to allow concurrent Conn#read() and
Conn#write() calls without one blocking the other. However, this
introduced a bug: outgoing data gets discarded when the TLS stream is
gracefully closed, because the read half is closed too early, before all
TLS control data has been received.

Fixes: denoland#9692
Fixes: denoland#10049
Fixes: denoland#10296
Fixes: denoland/std#750
piscisaureus added a commit to piscisaureus/deno that referenced this issue May 10, 2021
denoland#10146)

In denoland#9118, TLS streams were split into a "read half" and a "write half"
using tokio::io::split() to allow concurrent Conn#read() and
Conn#write() calls without one blocking the other. However, this
introduced a bug: outgoing data gets discarded when the TLS stream is
gracefully closed, because the read half is closed too early, before all
TLS control data has been received.

Fixes: denoland#9692
Fixes: denoland#10049
Fixes: denoland#10296
Fixes: denoland/std#750
@ry
Copy link
Member

ry commented May 11, 2021

Reopening. Fix revert in denoland/deno#10595. False alarm

@ry ry reopened this May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants