Example usage for io.netty.handler.ssl SniHandler SniHandler

List of usage examples for io.netty.handler.ssl SniHandler SniHandler

Introduction

In this page you can find the example usage for io.netty.handler.ssl SniHandler SniHandler.

Prototype

@SuppressWarnings("unchecked")
public SniHandler(AsyncMapping<? super String, ? extends SslContext> mapping) 

Source Link

Document

Creates a SNI detection handler with configured SslContext maintained by AsyncMapping

Usage

From source file:com.liferay.sync.engine.lan.server.file.LanFileServerInitializer.java

License:Open Source License

@Override
public void initChannel(SocketChannel socketChannel) {
    ChannelPipeline channelPipeline = socketChannel.pipeline();

    if (_domainNameMapping != null) {
        channelPipeline.addLast(new SniHandler(_domainNameMapping));
    }//from  www  .j a  va 2s .c o  m

    channelPipeline.addLast(new HttpServerCodec());
    channelPipeline.addLast(new HttpObjectAggregator(65536));
    channelPipeline.addLast(_syncTrafficShapingHandler);
    channelPipeline.addLast(new ChunkedWriteHandler());
    channelPipeline.addLast(new LanFileServerHandler(_syncTrafficShapingHandler));
}

From source file:com.linecorp.armeria.server.http.HttpServerPipelineConfigurator.java

License:Apache License

@Override
protected void initChannel(Channel ch) throws Exception {
    final ChannelPipeline p = ch.pipeline();
    p.addLast(new FlushConsolidationHandler());
    p.addLast(ReadSuppressingHandler.INSTANCE);

    if (port.protocol().isTls()) {
        p.addLast(new SniHandler(sslContexts));
        configureHttps(p);//from  ww w  .  ja  v a 2  s .c o  m
    } else {
        configureHttp(p);
    }
}

From source file:com.linecorp.armeria.server.HttpServerPipelineConfigurator.java

License:Apache License

private void configureHttps(ChannelPipeline p, @Nullable ProxiedAddresses proxiedAddresses) {
    assert sslContexts != null;
    p.addLast(new SniHandler(sslContexts));
    p.addLast(TrafficLoggingHandler.SERVER);
    p.addLast(new Http2OrHttpHandler(proxiedAddresses));
}

From source file:com.linecorp.armeria.server.ServerInitializer.java

License:Apache License

@Override
protected void initChannel(Channel ch) throws Exception {
    final ChannelPipeline p = ch.pipeline();

    if (port.protocol().isTls()) {
        p.addLast(new SniHandler(sslContexts));
        configureHttps(p);/*from w ww . ja  va2  s  .c  o  m*/
    } else {
        configureHttp(p);
    }
}