code: private void initHandshaker() {
          switch (connectionState) {
  
          //
          // Starting a new handshake.
          //
          case cs_START:
          case cs_DATA:
              break;
  
          //
          // We're already in the middle of a handshake.
          //
          case cs_HANDSHAKE:
          case cs_RENEGOTIATE:
              return;
  
          //
          // Anyone allowed to call this routine is required to
          // do so ONLY if the connection state is reasonable...
          //
          default:
              throw new IllegalStateException("Internal error");
          }
  
          // state is either cs_START or cs_DATA
          if (connectionState == cs_START) {
              connectionState = cs_HANDSHAKE;
          } else { // cs_DATA
              connectionState = cs_RENEGOTIATE;
          }
          if (roleIsServer) {
              handshaker = new ServerHandshaker(this, sslContext,
                      enabledProtocols, doClientAuth,
                      protocolVersion, connectionState == cs_HANDSHAKE,
                      secureRenegotiation, clientVerifyData, serverVerifyData);
          } else {
              handshaker = new ClientHandshaker(this, sslContext,
                      enabledProtocols,
                      protocolVersion, connectionState == cs_HANDSHAKE,
                      secureRenegotiation, clientVerifyData, serverVerifyData);
          }
          handshaker.setEnabledCipherSuites(enabledCipherSuites);
          handshaker.setEnableSessionCreation(enableSessionCreation);
      }
docs: Initialize the handshaker object. This means:
  
  . if a handshake is already in progress (state is cs_HANDSHAKE
  or cs_RENEGOTIATE), do nothing and return
  
  . if the engine is already closed, throw an Exception (internal error)
  
  . otherwise (cs_START or cs_DATA), create the appropriate handshaker
  object and advance the connection state (to cs_HANDSHAKE or
  cs_RENEGOTIATE, respectively).
  
  This method is called right after a new engine is created, when
  starting renegotiation, or when changing client/server mode of the
  engine.