use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class HttpServerTests method testIssue1978H2WithDelay.
@ParameterizedTest
@MethodSource("h2CompatibleCombinations")
void testIssue1978H2WithDelay(HttpProtocol[] serverProtocols, HttpProtocol[] clientProtocols) throws Exception {
Http2SslContextSpec serverCtx = Http2SslContextSpec.forServer(ssc.certificate(), ssc.privateKey());
Http2SslContextSpec clientCtx = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
doTestIssue1978(serverProtocols, clientProtocols, serverCtx, clientCtx, 50, 20);
}
use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class HttpServerTests method testIssue1286ErrorResponse_H2.
@Test
void testIssue1286ErrorResponse_H2() throws Exception {
Http2SslContextSpec serverCtx = Http2SslContextSpec.forServer(ssc.certificate(), ssc.privateKey());
Http2SslContextSpec clientCtx = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
doTestIssue1286(server -> server.protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(serverCtx)), client -> client.protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(clientCtx)), false, true);
}
use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class HttpServerTests method testIssue1286ErrorResponse_ServerHTTP11AndH2ClientH2.
@Test
void testIssue1286ErrorResponse_ServerHTTP11AndH2ClientH2() throws Exception {
Http2SslContextSpec serverCtx = Http2SslContextSpec.forServer(ssc.certificate(), ssc.privateKey());
Http2SslContextSpec clientCtx = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
doTestIssue1286(server -> server.protocol(HttpProtocol.H2, HttpProtocol.HTTP11).secure(spec -> spec.sslContext(serverCtx)), client -> client.protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(clientCtx)), false, true);
}
use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class HttpClientTest method testConnectionNoLifeTimeElasticPoolHttp2.
@Test
void testConnectionNoLifeTimeElasticPoolHttp2() throws Exception {
Http2SslContextSpec serverCtx = Http2SslContextSpec.forServer(ssc.certificate(), ssc.privateKey());
Http2SslContextSpec clientCtx = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
ConnectionProvider provider = ConnectionProvider.create("testConnectionNoLifeTimeElasticPoolHttp2", Integer.MAX_VALUE);
try {
ChannelId[] ids = doTestConnectionLifeTime(createServer().protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(serverCtx)), createClient(provider, () -> disposableServer.address()).protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(clientCtx)));
assertThat(ids[0]).isEqualTo(ids[1]);
} finally {
provider.disposeLater().block(Duration.ofSeconds(5));
}
}
use of reactor.netty.http.Http2SslContextSpec in project reactor-netty by reactor.
the class ConnectionPoolTests method testClientWithProtocols.
@Test
void testClientWithProtocols() {
Http11SslContextSpec http11SslContextSpec = Http11SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
Http2SslContextSpec http2SslContextSpec = Http2SslContextSpec.forClient().configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
HttpClient localClient1 = client.port(server3.port()).secure(spec -> spec.sslContext(http11SslContextSpec));
HttpClient localClient2 = localClient1.protocol(HttpProtocol.H2).secure(spec -> spec.sslContext(http2SslContextSpec));
checkResponsesAndChannelsStates("server3-ConnectionPoolTests", "server3-ConnectionPoolTests", localClient1, localClient2);
}
Aggregations