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

Can not get files that larger than 128k files with http2 over ssl #290

Closed
SajjadPourali opened this issue Jun 8, 2018 · 13 comments
Closed

Comments

@SajjadPourali
Copy link

SajjadPourali commented Jun 8, 2018

Hi,
I can not get files that larger than 128k files with http2 over SSL.
openssl and libssl-dev are 1.1.0h.

cargo.toml
env_logger = "0.5"
actix = "0.5"
actix-web = { version = "0.6", features=["alpn"] }
openssl = { version="0.10", features = ["v110"] }

Demo :
curl -v https://www.securation.com:4443/static/js/main.0632fced.js --http2
curl -v https://www.securation.com:4443/static/js/main.0632fced.js --http1.1

Log :

INFO 2018-06-08T0:56:39Z: actix_web::middleware::logger: 0.0.0.42:59128 [08/Jun/2018:16:56:30 -0400] "GET /static/js/main.0632fced.js HTTP/2.0" 200 61394 "-" "curl/7.54.0" 9.310509
INFO 2018-06-08T0:57:15Z: actix_web::middleware::logger: 0.0.0.42:59133 [08/Jun/2018:16:57:11 -0400] "GET /static/js/main.0632fced.js HTTP/2.0" 200 61394 "-" "curl/7.54.0" 3.955477
INFO 2018-06-08T0:57:24Z: actix_web::middleware::logger: 0.0.0.42:59134 [08/Jun/2018:16:57:21 -0400] "GET /static/js/main.0632fced.js HTTP/1.1" 200 520146 "-" "curl/7.54.0" 3.073752

It works correctly with http1.1 with SSL or http2 without SSL.

@fafhrd91
Copy link
Member

i am not sure about this problem. i can not reproduce.

@fafhrd91
Copy link
Member

what version of actix-web do you use?

@SajjadPourali
Copy link
Author

actix-web-0.6.12

@fafhrd91
Copy link
Member

Could you post response headers?

@SajjadPourali
Copy link
Author

SajjadPourali commented Jun 12, 2018

Demo is up.

curl -v https://www.securation.com:4443/static/js/main.0632fced.js --http2
curl -v https://www.securation.com:4443/static/js/main.0632fced.js --http1.1
curl -v https://www.securation.com:4443/static/js/main.0632fced.js --http2 -v 
*   Trying 198.143.180.42...
* TCP_NODELAY set
* Connected to www.securation.com (198.143.180.42) port 4443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=0x00.ir
*  start date: May 16 12:39:47 2018 GMT
*  expire date: Aug 14 12:39:47 2018 GMT
*  subjectAltName: host "www.securation.com" matched cert's "www.securation.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fa5de002000)
> GET /static/js/main.0632fced.js HTTP/2
> Host: www.securation.com:4443
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200 
< content-type: application/javascript
< content-disposition: attachment; filename=main.0632fced.js
< last-modified: Fri, 08 Jun 2018 19:37:35 GMT
< etag: "a173c:7efd2:5b1adaff:2230d446"
< accept-ranges: bytes
< content-length: 520146
< date: Tue, 12 Jun 2018 15:55:10 GMT

I don't think header can be useful

@SajjadPourali
Copy link
Author

SajjadPourali commented Jun 12, 2018

I did prepare a demo with Dockerfile to reproduce.
Dockerfile :

FROM debian

RUN sed -i -e 's/ \(stable\|stretch\)/ testing/ig' /etc/apt/sources.list
RUN apt --yes update
RUN apt --yes dist-upgrade
RUN apt --yes install curl libssl-dev build-essential openssl pkg-config git
RUN curl https://sh.rustup.rs > rustup.sh
RUN sh rustup.sh -y
WORKDIR /root/
RUN git clone https://github.com/SajjadPourali/actix-temp
WORKDIR /root/actix-temp
RUN /root/.cargo/bin/cargo build

@fafhrd91
Copy link
Member

could you check what version of h2 crate do you use?

@SajjadPourali
Copy link
Author

SajjadPourali commented Jun 12, 2018

It's last version of h2 (h2-0.1.9)

@SajjadPourali
Copy link
Author

Did you check Dockerfile ?
If you want, I can make and upload a VM that have this problem.

@fafhrd91
Copy link
Member

Let’s try VM. I on OS X and it works

@SajjadPourali
Copy link
Author

SajjadPourali commented Jun 13, 2018

Yes on OS X it correctly works.
when I did try it on docker in OS X and debian testing on parallels desktop it's have problem.
I will upload the image.
Do you agree with Parallels desktop ("pvm" file) ?

@fafhrd91
Copy link
Member

Ok, I’ll recheck tomorrow. I am traveling at the moment

@fafhrd91
Copy link
Member

fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants