private EmbeddedChannel createChannelSsl(GeneralNames subjectAltNames, String regex,
      Http2ClientMetrics http2ClientMetrics) {
    SslContext sslContext;
    X509Certificate cert;

    try {
      KeyPair cKP = TestSSLUtils.generateKeyPair("RSA");
      cert = TestSSLUtils.generateCertificate("CN=localhost, O=client", cKP, 30, "SHA1withRSA",
          Optional.of(subjectAltNames));

      SelfSignedCertificate localCert = new SelfSignedCertificate();
      sslContext = SslContextBuilder.forServer(localCert.certificate(), localCert.privateKey())
          .clientAuth(ClientAuth.REQUIRE)
          .build();
    } catch (CertificateException | SSLException | NoSuchAlgorithmException e) {
      throw new IllegalStateException(e);
    }
    SSLEngine sslEngine = sslContext.newEngine(ByteBufAllocator.DEFAULT);
    SSLEngine mockSSLEngine =
        new MockSSLEngine(sslEngine, new MockSSLSession(sslEngine.getSession(), new Certificate[]{cert}));
    SslHandler sslHandler = new SslHandler(mockSSLEngine);
    EmbeddedChannel channel = new EmbeddedChannel(sslHandler, new Http2PeerCertificateValidator(regex, http2ClientMetrics));
    return channel;
  }
Creates an {@link EmbeddedChannel} that incorporates an instance of {@link Http2PeerCertificateValidator}
@return an {@link EmbeddedChannel} that incorporates an instance of {@link Http2PeerCertificateValidator}
        and an {@link SslHandler}.
ambry-network/src/test/java/com/github/ambry/network/http2/Http2PeerCertificateValidatorTest.java