I installed HTTP/2 on a local Apache server, running on Ubuntu.
HTTP/2 is working, as it manages to upgrade the protocol when I do CURL on a page:
$ /usr/bin/curl -I --http2 http://test.local/public/
/usr/bin/curl: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/bin/curl)
HTTP/1.1 101 Switching Protocols
Upgrade: h2c
Connection: Upgrade
HTTP/2 200
...
Accessing the page from the browser, it still seems to be served as HTTP/1.1:
I would like HTTP/2 to work when served through the browser.
What am I missing here?
I've tried restarting my computer and Chromium, Chrome, FireFox and Brave without seeing it in HTTP/2. I've tried on WP, Symfony apps and simple HTML/CSS pages.
It turns out the browser requires HTTPS / SSL for HTTP/2 to work, while CURL doesn't.
Once I installed a local certificate and served the page over HTTPS, I got HTTP/2 in the browser and with CURL.