Home / Function/ testChooseClientAliasReturnsNull() — netty Function Reference

testChooseClientAliasReturnsNull() — netty Function Reference

Architecture documentation for the testChooseClientAliasReturnsNull() function in OpenSslKeyMaterialManagerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  cfa8910e_7c8f_ec69_e80d_8bb59aefe2f8["testChooseClientAliasReturnsNull()"]
  a2863871_c384_c4dd_4816_4f88c879c87d["OpenSslKeyMaterialManagerTest"]
  cfa8910e_7c8f_ec69_e80d_8bb59aefe2f8 -->|defined in| a2863871_c384_c4dd_4816_4f88c879c87d
  style cfa8910e_7c8f_ec69_e80d_8bb59aefe2f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java lines 35–85

    @Test
    public void testChooseClientAliasReturnsNull() throws SSLException {
        OpenSsl.ensureAvailability();

        X509ExtendedKeyManager keyManager = new X509ExtendedKeyManager() {
            @Override
            public String[] getClientAliases(String s, Principal[] principals) {
                return EmptyArrays.EMPTY_STRINGS;
            }

            @Override
            public String chooseClientAlias(String[] strings, Principal[] principals, Socket socket) {
                return null;
            }

            @Override
            public String[] getServerAliases(String s, Principal[] principals) {
                return EmptyArrays.EMPTY_STRINGS;
            }

            @Override
            public String chooseServerAlias(String s, Principal[] principals, Socket socket) {
                return null;
            }

            @Override
            public X509Certificate[] getCertificateChain(String s) {
                return EmptyArrays.EMPTY_X509_CERTIFICATES;
            }

            @Override
            public PrivateKey getPrivateKey(String s) {
                return null;
            }
        };

        OpenSslKeyMaterialManager manager = new OpenSslKeyMaterialManager(
                new OpenSslKeyMaterialProvider(keyManager, null) {
            @Override
            OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception {
                fail("Should not be called when alias is null");
                return null;
            }
        }, false);
        SslContext context = SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).build();
        OpenSslEngine engine =
                (OpenSslEngine) context.newEngine(UnpooledByteBufAllocator.DEFAULT);
        manager.setKeyMaterialClientSide(engine, EmptyArrays.EMPTY_STRINGS, null);
        ReferenceCountUtil.release(engine);
        ReferenceCountUtil.release(context);
    }

Domain

Subdomains

Frequently Asked Questions

What does testChooseClientAliasReturnsNull() do?
testChooseClientAliasReturnsNull() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java.
Where is testChooseClientAliasReturnsNull() defined?
testChooseClientAliasReturnsNull() is defined in handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java at line 35.

Analyze Your Own Codebase

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

Try Supermodel Free