HTTP/2 protocol error and no faster performance

kiti

Member
Sep 16, 2015
19
3
53
france
cPanel Access Level
Root Administrator
I have found problems with HTTP/2. This just a bottle to the ocean in case other people noticed the same thing.

Using curl -I and typing a url that should return a 404, I received the message:
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

I curl from my macbook and i know my curl works well with http/2 because i have tested curl against cloudflare.com

I tried to rebuild the HTTPD conf, I changed the global Apache config. to default but it didn't change anything so that I had to deactivate HTTP/2 to get a normal 404 error when I use a curl -I against a missing page. The existing pages work fine.

I have already seen the following:
GET / HTTP/1.1
Host: server.example.com
Connection: Upgrade
Upgrade: h2c

And server return 200 OK if didn't support HTTP/2. If support it then server returns:

HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: h2c
[ HTTP/2 connection ... ]

If you only look at the HTTP headers of the first bot request (example: google bot requests), this does not provide enough information about whether it accepts HTTP/2 because there is an upgrade process before exchanging data.

The HTTP/2 implementation looks much more complicated than marketed. I think it may have unexpected consequences for web servers. Is it worth taking a risk on production servers?

This was an old website on my cpanel installation. Strangely enough, I curled a missing page on a website that I have created in October 2017 in Cpanel and everything worked fine.

Also strangely enough, I have used pingdom to test a website with HTTP/2 and HTTP 1.1, and the pageload (using php 7 and wordpress) was always faster using HTTP 1.1
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello,

It's possible this relates to internal case EA-6979. This case is open to report an issue where using mod_http2 with a website configured to use the "suphp" or "cgi" handlers results in an HTTP/2 protocol error when making an HTTP/2 HEAD request to a PHP script URL.

Thank you.