Search in sources :

Example 1 with Http2FrameLoggingPerClientIpHandler

use of com.netflix.zuul.logging.Http2FrameLoggingPerClientIpHandler in project zuul by Netflix.

the class Http2SslChannelInitializer method initChannel.

@Override
protected void initChannel(Channel ch) throws Exception {
    SslHandler sslHandler = sslContext.newHandler(ch.alloc());
    sslHandler.engine().setEnabledProtocols(serverSslConfig.getProtocols());
    if (LOG.isDebugEnabled()) {
        LOG.debug("ssl protocols supported: {}", String.join(", ", sslHandler.engine().getSupportedProtocols()));
        LOG.debug("ssl protocols enabled: {}", String.join(", ", sslHandler.engine().getEnabledProtocols()));
        LOG.debug("ssl ciphers supported: {}", String.join(", ", sslHandler.engine().getSupportedCipherSuites()));
        LOG.debug("ssl ciphers enabled: {}", String.join(", ", sslHandler.engine().getEnabledCipherSuites()));
    }
    // Configure our pipeline of ChannelHandlerS.
    ChannelPipeline pipeline = ch.pipeline();
    storeChannel(ch);
    addTimeoutHandlers(pipeline);
    addPassportHandler(pipeline);
    addTcpRelatedHandlers(pipeline);
    pipeline.addLast(new Http2FrameLoggingPerClientIpHandler());
    pipeline.addLast("ssl", sslHandler);
    addSslInfoHandlers(pipeline, isSSlFromIntermediary);
    addSslClientCertChecks(pipeline);
    Http2MetricsChannelHandlers http2MetricsChannelHandlers = new Http2MetricsChannelHandlers(registry, "server", "http2-" + metricId);
    Http2ConnectionCloseHandler connectionCloseHandler = new Http2ConnectionCloseHandler(registry);
    Http2ConnectionExpiryHandler connectionExpiryHandler = new Http2ConnectionExpiryHandler(maxRequestsPerConnection, maxRequestsPerConnectionInBrownout, connectionExpiry);
    pipeline.addLast("http2CodecSwapper", new Http2OrHttpHandler(new Http2StreamInitializer(ch, this::http1Handlers, http2MetricsChannelHandlers, connectionCloseHandler, connectionExpiryHandler), channelConfig, cp -> {
        http1Codec(cp);
        http1Handlers(cp);
    }));
    pipeline.addLast("codec_placeholder", DUMMY_HANDLER);
    pipeline.addLast(swallowSomeHttp2ExceptionsHandler);
}
Also used : Http2FrameLoggingPerClientIpHandler(com.netflix.zuul.logging.Http2FrameLoggingPerClientIpHandler) ChannelGroup(io.netty.channel.group.ChannelGroup) Logger(org.slf4j.Logger) SslContext(io.netty.handler.ssl.SslContext) SwallowSomeHttp2ExceptionsHandler(com.netflix.netty.common.SwallowSomeHttp2ExceptionsHandler) ServerSslConfig(com.netflix.netty.common.ssl.ServerSslConfig) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) LoggerFactory(org.slf4j.LoggerFactory) ChannelPipeline(io.netty.channel.ChannelPipeline) BaseZuulChannelInitializer(com.netflix.zuul.netty.server.BaseZuulChannelInitializer) CommonChannelConfigKeys(com.netflix.netty.common.channel.config.CommonChannelConfigKeys) Channel(io.netty.channel.Channel) SslHandler(io.netty.handler.ssl.SslHandler) Http2ConnectionExpiryHandler(com.netflix.netty.common.Http2ConnectionExpiryHandler) SslContextFactory(com.netflix.zuul.netty.ssl.SslContextFactory) Http2ConnectionCloseHandler(com.netflix.netty.common.Http2ConnectionCloseHandler) ChannelConfig(com.netflix.netty.common.channel.config.ChannelConfig) Http2MetricsChannelHandlers(com.netflix.netty.common.metrics.Http2MetricsChannelHandlers) Http2FrameLoggingPerClientIpHandler(com.netflix.zuul.logging.Http2FrameLoggingPerClientIpHandler) Http2MetricsChannelHandlers(com.netflix.netty.common.metrics.Http2MetricsChannelHandlers) Http2ConnectionExpiryHandler(com.netflix.netty.common.Http2ConnectionExpiryHandler) Http2ConnectionCloseHandler(com.netflix.netty.common.Http2ConnectionCloseHandler) SslHandler(io.netty.handler.ssl.SslHandler) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 Http2ConnectionCloseHandler (com.netflix.netty.common.Http2ConnectionCloseHandler)1 Http2ConnectionExpiryHandler (com.netflix.netty.common.Http2ConnectionExpiryHandler)1 SwallowSomeHttp2ExceptionsHandler (com.netflix.netty.common.SwallowSomeHttp2ExceptionsHandler)1 ChannelConfig (com.netflix.netty.common.channel.config.ChannelConfig)1 CommonChannelConfigKeys (com.netflix.netty.common.channel.config.CommonChannelConfigKeys)1 Http2MetricsChannelHandlers (com.netflix.netty.common.metrics.Http2MetricsChannelHandlers)1 ServerSslConfig (com.netflix.netty.common.ssl.ServerSslConfig)1 Http2FrameLoggingPerClientIpHandler (com.netflix.zuul.logging.Http2FrameLoggingPerClientIpHandler)1 BaseZuulChannelInitializer (com.netflix.zuul.netty.server.BaseZuulChannelInitializer)1 SslContextFactory (com.netflix.zuul.netty.ssl.SslContextFactory)1 Channel (io.netty.channel.Channel)1 ChannelPipeline (io.netty.channel.ChannelPipeline)1 ChannelGroup (io.netty.channel.group.ChannelGroup)1 SslContext (io.netty.handler.ssl.SslContext)1 SslHandler (io.netty.handler.ssl.SslHandler)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1