Home / Function/ testSessionBindingEvent() — netty Function Reference

testSessionBindingEvent() — netty Function Reference

Architecture documentation for the testSessionBindingEvent() function in SSLEngineTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9["testSessionBindingEvent()"]
  9150c92a_2afc_b83a_c3bf_86dfac6e9d9b["SSLEngineTest"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|defined in| 9150c92a_2afc_b83a_c3bf_86dfac6e9d9b
  bf19737b_7dc7_9dfd_0a67_ae31448ebbe8["protocols()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| bf19737b_7dc7_9dfd_0a67_ae31448ebbe8
  e3b541e6_b593_4b1f_a637_da19020e73df["ciphers()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| e3b541e6_b593_4b1f_a637_da19020e73df
  7380f50e_d3f0_3078_ee65_de1cb780c79d["handshake()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 7380f50e_d3f0_3078_ee65_de1cb780c79d
  13aca077_a788_4333_9f8b_2b1437653846["delegate()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 13aca077_a788_4333_9f8b_2b1437653846
  1d636ae2_d917_fb89_3e82_3595a6b7332e["valueBound()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 1d636ae2_d917_fb89_3e82_3595a6b7332e
  65f71b69_9242_2a75_3781_a0148d308b62["valueUnbound()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 65f71b69_9242_2a75_3781_a0148d308b62
  7b9afd48_e1e0_930c_4d61_c8a63d3e7bbc["assertSSLSessionBindingEventValue()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 7b9afd48_e1e0_930c_4d61_c8a63d3e7bbc
  87e8e20d_ffbe_f5c3_4fd0_7d8ac419206d["cleanupClientSslEngine()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 87e8e20d_ffbe_f5c3_4fd0_7d8ac419206d
  78ad5fe5_58d2_9877_f633_22a7048c0e5e["cleanupServerSslEngine()"]
  3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 -->|calls| 78ad5fe5_58d2_9877_f633_22a7048c0e5e
  style 3ffa1c64_a4f8_da43_f6b2_3d1dd414b6d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java lines 3532–3603

    @MethodSource("newTestParams")
    @ParameterizedTest
    public void testSessionBindingEvent(SSLEngineTestParam param) throws Exception {
        clientSslCtx = wrapContext(param, SslContextBuilder.forClient()
                .trustManager(InsecureTrustManagerFactory.INSTANCE)
                .sslProvider(sslClientProvider())
                .sslContextProvider(clientSslContextProvider())
                .protocols(param.protocols())
                .ciphers(param.ciphers())
                .build());
        SelfSignedCertificate ssc = CachedSelfSignedCertificate.getCachedCertificate();
        serverSslCtx = wrapContext(param, SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey())
                .sslProvider(sslServerProvider())
                .sslContextProvider(serverSslContextProvider())
                .protocols(param.protocols())
                .ciphers(param.ciphers())
                .build());
        SSLEngine clientEngine = null;
        SSLEngine serverEngine = null;
        try {
            clientEngine = wrapEngine(clientSslCtx.newEngine(UnpooledByteBufAllocator.DEFAULT));
            serverEngine = wrapEngine(serverSslCtx.newEngine(UnpooledByteBufAllocator.DEFAULT));
            handshake(param.type(), param.delegate(), clientEngine, serverEngine);
            SSLSession session = clientEngine.getSession();
            assertEquals(0, session.getValueNames().length);

            class SSLSessionBindingEventValue implements SSLSessionBindingListener {
                SSLSessionBindingEvent boundEvent;
                SSLSessionBindingEvent unboundEvent;

                @Override
                public void valueBound(SSLSessionBindingEvent sslSessionBindingEvent) {
                    assertNull(boundEvent);
                    boundEvent = sslSessionBindingEvent;
                }

                @Override
                public void valueUnbound(SSLSessionBindingEvent sslSessionBindingEvent) {
                    assertNull(unboundEvent);
                    unboundEvent = sslSessionBindingEvent;
                }
            }

            String name = "name";
            String name2 = "name2";

            SSLSessionBindingEventValue value1 = new SSLSessionBindingEventValue();
            session.putValue(name, value1);
            assertSSLSessionBindingEventValue(name, session, value1.boundEvent);
            assertNull(value1.unboundEvent);
            assertEquals(1, session.getValueNames().length);

            session.putValue(name2, "value");

            SSLSessionBindingEventValue value2 = new SSLSessionBindingEventValue();
            session.putValue(name, value2);
            assertEquals(2, session.getValueNames().length);

            assertSSLSessionBindingEventValue(name, session, value1.unboundEvent);
            assertSSLSessionBindingEventValue(name, session, value2.boundEvent);
            assertNull(value2.unboundEvent);
            assertEquals(2, session.getValueNames().length);

            session.removeValue(name);
            assertSSLSessionBindingEventValue(name, session, value2.unboundEvent);
            assertEquals(1, session.getValueNames().length);
            session.removeValue(name2);
        } finally {
            cleanupClientSslEngine(clientEngine);
            cleanupServerSslEngine(serverEngine);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testSessionBindingEvent() do?
testSessionBindingEvent() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java.
Where is testSessionBindingEvent() defined?
testSessionBindingEvent() is defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java at line 3532.
What does testSessionBindingEvent() call?
testSessionBindingEvent() calls 9 function(s): assertSSLSessionBindingEventValue, ciphers, cleanupClientSslEngine, cleanupServerSslEngine, delegate, handshake, protocols, valueBound, and 1 more.

Analyze Your Own Codebase

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

Try Supermodel Free