-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Document how to enable h2c via programmatic configuration #21997
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
Comments
The documentation is probably worded a bit too strongly at the moment. What it really means is that there's no support for enabling h2c via configuration properties. You can still do so by adding a little bit of your own configuration. For example, the following customiser will enable h2c with Tomcat:
We should probably add something to the documentation showing what's necessary for Jetty, Netty, Tomcat, and Undertow. |
Thank you for the response. My point here was that the level of opinionation currently is too strong: that comes across both in the documentation and the lack of configuration properties. Sorry if that wasn't clear! Changing the documentation to say it is not enabled by default (vs. not supported), and then providing code snippets seems like a good balance between secure defaults and flexibility. |
Hi, Is this the only bit that needs changing? It seems this does not work with Spring Boot 2.2 and Tomcat 9.0.21-9.0.37; I get a 500 error when I try to upgrade the connection to HTTP/2.0 with curl, see stack trace below. Could you please document the exact changes needed to enable H2C in Spring Boot (in my case, with Tomcat)?
|
@dvlato The bean in my comment above should be all that is necessary. Your stack trace suggests that a |
Spring Boot currently documents explicitly that it does not support h2c (i.e. HTTP/2 in the clear, no encryption). There are sound policy reasons for this as a default position, particularly assuming that the Spring Boot application faces the internet.
However, this complicates the adoption of Spring Boot for service mesh use cases where an L7 proxy (e.g. Envoy) is actually managing certificates and encrypted connections across the network, and the connection between the service and the proxy is just host-local. In this case, h2c between the proxy and the service is the most appropriate technical choice.
Is there not a case for allowing h2c via configuration for these use cases?
The text was updated successfully, but these errors were encountered: