Reputation: 1862
I am learning about HTTP2 and developed a POC using jetty which is working fine in chrome.
But when i hit the same URL in firefox i HTTP2 URL request got blank page with exception saying "The page you are trying to view cannot be shown because the authenticity of the received data could not be verified." After searching around found that in firefox i have to enable network.http.spdy.enabled.http2 from "about:config".
My question is if the browser does not support the HTTP2 is there any mechanism on server or browser side to fallback to HTTP1.
Upvotes: 2
Views: 4750
Reputation: 18477
Jetty does support fallback to HTTP/1.1 if the client does not support HTTP/2.
Without looking at the server side code, I am guessing that you are not adding the HttpConnectionFactory
as one of the factories when you configure the ServerConnector
, and therefore you don't get fallback.
Also, bear in mind that the fallback goes from HTTP/2 over TLS to HTTP/1.1 over TLS; in other words you are in "https" land and you will remain there, no matter if you are using HTTP/2 or HTTP/1.1. Hence, you need to have a proper certificate in place in order for the fallback to happen: you cannot go from encrypted HTTP/2 to clear-text HTTP/1.1.
This example shows you how to properly setup a working HTTP/2 server with fallback to HTTP/1.1.
Upvotes: 5