static SslContext getServerSslContext(SSLConfig config) throws GeneralSecurityException, IOException {
    logger.info("Using {} provider for server SslContext", SslContext.defaultServerProvider());
    SslContextBuilder sslContextBuilder;
    if (config.sslHttp2SelfSign) {
      // Both server and client should use InsecureTrustManage for self-sign case.
      SelfSignedCertificate ssc = new SelfSignedCertificate();
      sslContextBuilder = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey())
          .trustManager(InsecureTrustManagerFactory.INSTANCE);
      logger.info("Server Uses Self Signed Certificate.");
    } else {
      sslContextBuilder = SslContextBuilder.forServer(NettySslFactory.getKeyManagerFactory(config))
          .trustManager(NettySslFactory.getTrustManagerFactory(config));
    }
    return sslContextBuilder.sslProvider(SslContext.defaultClientProvider())
        .clientAuth(NettySslFactory.getClientAuth(config))
        // NOTE: the cipher filter may not include all ciphers required by the HTTP/2 specification.
        // Please refer to the HTTP/2 specification for cipher requirements.
        .ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE)
        .applicationProtocolConfig(new ApplicationProtocolConfig(ApplicationProtocolConfig.Protocol.ALPN,
            // NO_ADVERTISE is currently the only mode supported by both OpenSsl and JDK providers.
            ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,
            // ACCEPT is currently the only mode supported by both OpenSsl and JDK providers.
            ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT, ApplicationProtocolNames.HTTP_2))
        .build();
  }
@param config the {@link SSLConfig}
@return a configured {@link SslContext} object for a client.
@throws GeneralSecurityException
@throws IOException
ambry-commons/src/main/java/com/github/ambry/commons/NettySslHttp2Factory.java