Search in sources :

Example 1 with Http1xOrH2CHandler

use of io.vertx.core.http.impl.Http1xOrH2CHandler 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();
}
Also used : Http1xServerConnection(io.vertx.core.http.impl.Http1xServerConnection) HttpServerImpl(io.vertx.core.http.impl.HttpServerImpl) IntStream(java.util.stream.IntStream) java.util(java.util) io.vertx.core(io.vertx.core) ContextInternal(io.vertx.core.impl.ContextInternal) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Http1xOrH2CHandler(io.vertx.core.http.impl.Http1xOrH2CHandler) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) SimpleServer(io.vertx.test.verticles.SimpleServer) TestUtils(io.vertx.test.core.TestUtils) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) WriteStream(io.vertx.core.streams.WriteStream) BiConsumer(java.util.function.BiConsumer) RecordParser(io.vertx.core.parsetools.RecordParser) JsonObject(io.vertx.core.json.JsonObject) Assume(org.junit.Assume) CheckingSender(io.vertx.test.core.CheckingSender) VertxInternal(io.vertx.core.impl.VertxInternal) Http1xUpgradeToH2CHandler(io.vertx.core.http.impl.Http1xUpgradeToH2CHandler) ConcurrentHashSet(io.vertx.core.impl.ConcurrentHashSet) java.util.concurrent(java.util.concurrent) TooLongFrameException(io.netty.handler.codec.TooLongFrameException) Test(org.junit.Test) Http1xServerConnection(io.vertx.core.http.impl.Http1xServerConnection) EventLoop(io.netty.channel.EventLoop) Future(io.vertx.core.Future) io.vertx.core.net(io.vertx.core.net) Collectors(java.util.stream.Collectors) File(java.io.File) LongConsumer(java.util.function.LongConsumer) Channel(io.netty.channel.Channel) Consumer(java.util.function.Consumer) EventLoopContext(io.vertx.core.impl.EventLoopContext) JsonArray(io.vertx.core.json.JsonArray) Repeat(io.vertx.test.core.Repeat) Stream(java.util.stream.Stream) Buffer(io.vertx.core.buffer.Buffer) HttpUtils(io.vertx.core.http.impl.HttpUtils) Cert(io.vertx.test.tls.Cert) ChannelHandler(io.netty.channel.ChannelHandler) PUT(io.vertx.core.http.HttpMethod.PUT) Http1xOrH2CHandler(io.vertx.core.http.impl.Http1xOrH2CHandler) Channel(io.netty.channel.Channel) Http1xUpgradeToH2CHandler(io.vertx.core.http.impl.Http1xUpgradeToH2CHandler) ChannelHandler(io.netty.channel.ChannelHandler) Test(org.junit.Test)

Aggregations

Channel (io.netty.channel.Channel)1 ChannelHandler (io.netty.channel.ChannelHandler)1 EventLoop (io.netty.channel.EventLoop)1 TooLongFrameException (io.netty.handler.codec.TooLongFrameException)1 io.vertx.core (io.vertx.core)1 Future (io.vertx.core.Future)1 Buffer (io.vertx.core.buffer.Buffer)1 PUT (io.vertx.core.http.HttpMethod.PUT)1 Http1xOrH2CHandler (io.vertx.core.http.impl.Http1xOrH2CHandler)1 Http1xServerConnection (io.vertx.core.http.impl.Http1xServerConnection)1 Http1xUpgradeToH2CHandler (io.vertx.core.http.impl.Http1xUpgradeToH2CHandler)1 HttpServerImpl (io.vertx.core.http.impl.HttpServerImpl)1 HttpUtils (io.vertx.core.http.impl.HttpUtils)1 ConcurrentHashSet (io.vertx.core.impl.ConcurrentHashSet)1 ContextInternal (io.vertx.core.impl.ContextInternal)1 EventLoopContext (io.vertx.core.impl.EventLoopContext)1 VertxInternal (io.vertx.core.impl.VertxInternal)1 JsonArray (io.vertx.core.json.JsonArray)1 JsonObject (io.vertx.core.json.JsonObject)1 io.vertx.core.net (io.vertx.core.net)1