use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class HttpClientNoMicrometerTest method clientCreatedWithMetricsDoesntLoadGaugeHttp2.
@Test
void clientCreatedWithMetricsDoesntLoadGaugeHttp2() throws Exception {
SelfSignedCertificate ssc = new SelfSignedCertificate();
Http2SslContextSpec serverCtx = Http2SslContextSpec.forServer(ssc.certificate(), ssc.privateKey());
Http2SslContextSpec clientCtx = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
ConnectionProvider provider = ConnectionProvider.builder("foo2").metrics(true, NoOpMeterRegistrar::new).build();
try {
doTestClientCreatedWithMetricsDoesntLoadGauge(HttpServer.create().protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(serverCtx)), HttpClient.create(provider).protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(clientCtx)));
} finally {
provider.disposeLater().block(Duration.ofSeconds(5));
}
}
use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class H2Application method main.
public static void main(String[] args) {
File cert = new File("certificate.crt");
File key = new File("private.key");
Http2SslContextSpec http2SslContextSpec = Http2SslContextSpec.forServer(cert, key);
DisposableServer server = HttpServer.create().port(8080).protocol(// <1>
HttpProtocol.H2).secure(// <2>
spec -> spec.sslContext(http2SslContextSpec)).handle((request, response) -> response.sendString(Mono.just("hello"))).bindNow();
server.onDispose().block();
}
Aggregations