79519994

Date: 2025-03-19 11:09:56
Score: 0.5
Natty:
Report link

later, I generated a keystore for the server and a truststore for the client. Add dependency netty-incubator-codec-native-quic for client. Configure http3client:

SslBundle sslBundle = factory.getSslBundles().getBundle("http3");
        TrustManager[] trustManagers = sslBundle.getManagers().getTrustManagers();
        Http3SslContextSpec sslContextSpec = Http3SslContextSpec
                .forClient()
                .configure(s -> s.trustManager(trustManagers[0]));
        
        return HttpClient.create()
                // Configure HTTP/3 protocol
                .protocol(HttpProtocol.HTTP3)
                // Configure HTTP/3 settings
                .secure(spec -> spec.sslContext(sslContextSpec))
                .http3Settings(spec -> spec
                        .idleTimeout(Duration.ofSeconds(5))
                        .maxData(10_000_000)
                        .maxStreamDataBidirectionalLocal(1_000_000));

And it works!

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ThinkDifferent