Home / Function/ testConnectMutualAuthSuccess() — netty Function Reference

testConnectMutualAuthSuccess() — netty Function Reference

Architecture documentation for the testConnectMutualAuthSuccess() function in QuicChannelConnectTest.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 4

Entity Profile

Dependency Diagram

graph TD
  e63623bd_78ef_256d_8ae1_8f43e30d4ccc["testConnectMutualAuthSuccess()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663["QuicChannelConnectTest"]
  e63623bd_78ef_256d_8ae1_8f43e30d4ccc -->|defined in| 1e1bc485_1969_4537_ef9b_f28971b2f663
  cebc3ba3_b540_c982_7af0_4e4429ff8d08["testConnectMutualAuthRequiredSuccess()"]
  cebc3ba3_b540_c982_7af0_4e4429ff8d08 -->|calls| e63623bd_78ef_256d_8ae1_8f43e30d4ccc
  b80901bb_59d1_cd80_5c8b_6e3d5913a046["testConnectMutualAuthOptionalWithCertSuccess()"]
  b80901bb_59d1_cd80_5c8b_6e3d5913a046 -->|calls| e63623bd_78ef_256d_8ae1_8f43e30d4ccc
  741422a1_978a_fcef_8810_bc19661aff9d["testConnectMutualAuthOptionalWithoutKeyManagerSuccess()"]
  741422a1_978a_fcef_8810_bc19661aff9d -->|calls| e63623bd_78ef_256d_8ae1_8f43e30d4ccc
  355f3801_8788_3e9f_bd16_b27d85b91164["testConnectMutualAuthOptionalWithoutKeyInKeyManagerSuccess()"]
  355f3801_8788_3e9f_bd16_b27d85b91164 -->|calls| e63623bd_78ef_256d_8ae1_8f43e30d4ccc
  5f0fc68a_3438_a865_1307_d0a3144b2c00["assertState()"]
  e63623bd_78ef_256d_8ae1_8f43e30d4ccc -->|calls| 5f0fc68a_3438_a865_1307_d0a3144b2c00
  style e63623bd_78ef_256d_8ae1_8f43e30d4ccc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java lines 1261–1345

    private void testConnectMutualAuthSuccess(Executor executor, MutalAuthTestMode mode) throws Throwable {
        Channel server = QuicTestUtils.newServer(QuicTestUtils.newQuicServerBuilder(executor,
                        QuicSslContextBuilder.forServer(
                                        QuicTestUtils.SELF_SIGNED_CERTIFICATE.privateKey(), null,
                                        QuicTestUtils.SELF_SIGNED_CERTIFICATE.certificate()).trustManager(
                                        InsecureTrustManagerFactory.INSTANCE)
                                .applicationProtocols(QuicTestUtils.PROTOS)
                                .clientAuth(mode == MutalAuthTestMode.REQUIRED ?
                                        ClientAuth.REQUIRE : ClientAuth.OPTIONAL).build()),
                TestQuicTokenHandler.INSTANCE, new ChannelInboundHandlerAdapter(),
                new ChannelInboundHandlerAdapter());
        InetSocketAddress address = (InetSocketAddress) server.localAddress();

        QuicSslContextBuilder clientSslCtxBuilder = QuicSslContextBuilder.forClient()
                .trustManager(InsecureTrustManagerFactory.INSTANCE)
                .applicationProtocols(QuicTestUtils.PROTOS);
        switch (mode) {
            case OPTIONAL_CERT:
            case REQUIRED:
                clientSslCtxBuilder.keyManager(
                        QuicTestUtils.SELF_SIGNED_CERTIFICATE.privateKey(), null,
                        QuicTestUtils.SELF_SIGNED_CERTIFICATE.certificate());
                break;
            case OPTIONAL_NO_KEY_IN_KEYMANAGER:
                clientSslCtxBuilder.keyManager(new X509ExtendedKeyManager() {
                    @Override
                    public String[] getClientAliases(String keyType, Principal[] issuers) {
                        throw new UnsupportedOperationException();
                    }

                    @Override
                    @Nullable
                    public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) {
                        return null;
                    }

                    @Override
                    public String[] getServerAliases(String keyType, Principal[] issuers) {
                        throw new UnsupportedOperationException();
                    }

                    @Override
                    public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) {
                        throw new UnsupportedOperationException();
                    }

                    @Override
                    public X509Certificate[] getCertificateChain(String alias) {
                        throw new UnsupportedOperationException();
                    }

                    @Override
                    public PrivateKey getPrivateKey(String alias) {
                        throw new UnsupportedOperationException();
                    }
                }, null);
                break;
            case OPTIONAL_NO_KEYMANAGER:
                break;
            default:
                throw new IllegalStateException();
        }

        Channel channel = QuicTestUtils.newClient(QuicTestUtils.newQuicClientBuilder(executor,
                clientSslCtxBuilder.build()));
        try {
            ChannelActiveVerifyHandler clientQuicChannelHandler = new ChannelActiveVerifyHandler();
            QuicChannel quicChannel = QuicTestUtils.newQuicChannelBootstrap(channel)
                    .handler(clientQuicChannelHandler)
                    .streamHandler(new ChannelInboundHandlerAdapter())
                    .remoteAddress(address)
                    .connect()
                    .get();
            assertTrue(quicChannel.close().await().isSuccess());
            ChannelFuture closeFuture = quicChannel.closeFuture().await();
            assertTrue(closeFuture.isSuccess());
            clientQuicChannelHandler.assertState();
        } finally {
            server.close().sync();
            // Close the parent Datagram channel as well.
            channel.close().sync();

Domain

Subdomains

Frequently Asked Questions

What does testConnectMutualAuthSuccess() do?
testConnectMutualAuthSuccess() is a function in the netty codebase, defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java.
Where is testConnectMutualAuthSuccess() defined?
testConnectMutualAuthSuccess() is defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java at line 1261.
What does testConnectMutualAuthSuccess() call?
testConnectMutualAuthSuccess() calls 1 function(s): assertState.
What calls testConnectMutualAuthSuccess()?
testConnectMutualAuthSuccess() is called by 4 function(s): testConnectMutualAuthOptionalWithCertSuccess, testConnectMutualAuthOptionalWithoutKeyInKeyManagerSuccess, testConnectMutualAuthOptionalWithoutKeyManagerSuccess, testConnectMutualAuthRequiredSuccess.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free