如何使用外部SSL卸载在HTTP2中配置Jetty

https://github.com/eclipse/jetty.project下的所有示例中都包含ssl工厂。

在我的情况下,ssl卸载是使用自签名证书在nginx级别完成的。

我需要的只是配置了h2连接器(甚至没有h1)。

baogang888999 回答:如何使用外部SSL卸载在HTTP2中配置Jetty

使用h2c通过HTTP2CServerConnectionFactory连接器设置码头。

如果您使用的是jetty-home(或更旧的jetty-distribution),则只需启用http2c模块。

如果您使用嵌入式码头,请对连接器使用以下粗略轮廓。

HttpConfiguration config = new HttpConfiguration();
// ... configure 

HTTP2CServerConnectionFactory http2c = new HTTP2CServerConnectionFactory(config);
ServerConnector connector = new ServerConnector(this,http1,http2c);
connector.setPort(port);
server.addConnector(connector);
本文链接:https://www.f2er.com/3098461.html

大家都在问