Home / Function/ beginHandshake() — netty Function Reference

beginHandshake() — netty Function Reference

Architecture documentation for the beginHandshake() function in ReferenceCountedOpenSslEngine.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  91f19139_f45d_587f_8928_e46af45c559d["beginHandshake()"]
  df1ad81e_e5bf_85e6_4418_db301b4c3e66["ReferenceCountedOpenSslEngine"]
  91f19139_f45d_587f_8928_e46af45c559d -->|defined in| df1ad81e_e5bf_85e6_4418_db301b4c3e66
  45db14f5_962d_6891_30d4_e421c0aed253["checkEngineClosed()"]
  91f19139_f45d_587f_8928_e46af45c559d -->|calls| 45db14f5_962d_6891_30d4_e421c0aed253
  d0f145d8_8f24_09af_02a9_d6a3f99d7a51["calculateMaxWrapOverhead()"]
  91f19139_f45d_587f_8928_e46af45c559d -->|calls| d0f145d8_8f24_09af_02a9_d6a3f99d7a51
  91fc1e9f_da8a_5369_c205_f01b69e8bd01["SSLException()"]
  91f19139_f45d_587f_8928_e46af45c559d -->|calls| 91fc1e9f_da8a_5369_c205_f01b69e8bd01
  70ac8c99_3ca9_c202_a13f_16dda4571164["handshake()"]
  91f19139_f45d_587f_8928_e46af45c559d -->|calls| 70ac8c99_3ca9_c202_a13f_16dda4571164
  3ddadf00_257d_ea94_ec2c_9afd83ac4524["getHandshakeStatus()"]
  91f19139_f45d_587f_8928_e46af45c559d -->|calls| 3ddadf00_257d_ea94_ec2c_9afd83ac4524
  style 91f19139_f45d_587f_8928_e46af45c559d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java lines 1868–1900

    @Override
    public final synchronized void beginHandshake() throws SSLException {
        switch (handshakeState) {
            case STARTED_IMPLICITLY:
                checkEngineClosed();

                // A user did not start handshake by calling this method by him/herself,
                // but handshake has been started already by wrap() or unwrap() implicitly.
                // Because it's the user's first time to call this method, it is unfair to
                // raise an exception.  From the user's standpoint, he or she never asked
                // for renegotiation.

                handshakeState = HandshakeState.STARTED_EXPLICITLY; // Next time this method is invoked by the user,
                calculateMaxWrapOverhead();
                // we should raise an exception.
                break;
            case STARTED_EXPLICITLY:
                // Nothing to do as the handshake is not done yet.
                break;
            case FINISHED:
                throw new SSLException("renegotiation unsupported");
            case NOT_STARTED:
                handshakeState = HandshakeState.STARTED_EXPLICITLY;
                if (handshake() == NEED_TASK) {
                    // Set needTask to true so getHandshakeStatus() will return the correct value.
                    needTask = true;
                }
                calculateMaxWrapOverhead();
                break;
            default:
                throw new Error("Unexpected handshake state: " + handshakeState);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does beginHandshake() do?
beginHandshake() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java.
Where is beginHandshake() defined?
beginHandshake() is defined in handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java at line 1868.
What does beginHandshake() call?
beginHandshake() calls 5 function(s): SSLException, calculateMaxWrapOverhead, checkEngineClosed, getHandshakeStatus, handshake.

Analyze Your Own Codebase

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

Try Supermodel Free