TlsContextBasedProvider extends AbstractComponent implements SslContextFactoryProvider { @Override public final SslContextFactory getInstance(String containerId, int port) { TlsContext tlsContext = getTlsContext(containerId, port); SSLContext sslContext = tlsContext.context(); SSLParameters parameters = tlsContext.parameters(); SslContextFactory.Server sslContextFactory = new SslContextFactory.Server(); sslContextFactory.setSslContext(sslContext); sslContextFactory.setNeedClientAuth(parameters.getNeedClientAuth()); sslContextFactory.setWantClientAuth(parameters.getWantClientAuth()); setEnabledProtocols(sslContextFactory, sslContext, List.of(parameters.getProtocols())); setEnabledCipherSuites(sslContextFactory, sslContext, List.of(parameters.getCipherSuites())); return sslContextFactory; }  @Override final SslContextFactory getInstance(String containerId, int port);  }
@Test public void creates_sslcontextfactory_from_tlscontext() { TlsContext tlsContext = createTlsContext(); var provider = new SimpleTlsContextBasedProvider(tlsContext); SslContextFactory sslContextFactory = provider.getInstance("dummyContainerId", 8080); assertNotNull(sslContextFactory); assertArrayEquals(tlsContext.parameters().getCipherSuites(), sslContextFactory.getIncludeCipherSuites()); }