use of io.vertx.core.http.impl.Http1xUpgradeToH2CHandler in project vert.x by eclipse.
the class Http1xTest method testTLSDisablesH2CHandlers.
@Test
public void testTLSDisablesH2CHandlers() throws Exception {
server.close();
server = vertx.createHttpServer(createBaseServerOptions().setSsl(true).setKeyCertOptions(Cert.SERVER_JKS.get())).connectionHandler(conn -> {
Channel channel = ((Http1xServerConnection) conn).channel();
for (Map.Entry<String, ChannelHandler> stringChannelHandlerEntry : channel.pipeline()) {
ChannelHandler handler = stringChannelHandlerEntry.getValue();
assertFalse(handler instanceof Http1xUpgradeToH2CHandler);
assertFalse(handler instanceof Http1xOrH2CHandler);
}
}).requestHandler(req -> {
req.response().end();
});
startServer(testAddress);
client.close();
client = vertx.createHttpClient(new HttpClientOptions().setTrustAll(true).setSsl(true));
client.request(requestOptions).compose(req -> req.send().compose(HttpClientResponse::body)).onComplete(onSuccess(v -> {
testComplete();
}));
await();
}
Aggregations