@Test
void shouldIncludeSniHostName() throws Exception
{

    BoltServerAddress address = new BoltServerAddress( "database.neo4j.com", 8989 );
    NettyChannelInitializer initializer = new NettyChannelInitializer( address, trustAllCertificates(), 10000, Clock.SYSTEM, DEV_NULL_LOGGING );
    initializer.initChannel( channel );
    SslHandler sslHandler = channel.pipeline().get( SslHandler.class );
    SSLEngine sslEngine = sslHandler.engine();
    SSLParameters sslParameters = sslEngine.getSSLParameters();
    List<SNIServerName> sniServerNames = sslParameters.getServerNames();
    assertThat( sniServerNames, hasSize( 1 ) );
    assertThat( sniServerNames.get( 0 ), instanceOf( SNIHostName.class ) );
    assertThat( ((SNIHostName) sniServerNames.get( 0 )).getAsciiName(), equalTo( address.host() ) );
}