protected void readyOutboundPostHandshake(
                                              WsByteBuffer netBuffer,
                                              WsByteBuffer decryptedNetBuffer,
                                              WsByteBuffer encryptedAppBuffer,
                                              HandshakeStatus hsStatus,
                                              boolean async) throws IOException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "readyOutboundPostHandshake, vc=" + getVCHash());
        }

        // Exception to call destroy with in case of bad return code from SSL engine.
        IOException exception = null;

        if (hsStatus != HandshakeStatus.FINISHED) {
            // Handshake failed.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Unexpected results of handshake after connect, " + hsStatus);
            }
            exception = new IOException("Unexpected results of handshake after connect, " + hsStatus);
        }

        // PK16095 - take certain actions when the handshake completes
        getChannel().onHandshakeFinish(getSSLEngine());

        // Null out the buffer references on the device side so they don't wrongly reused later.
        getDeviceReadInterface().setBuffers(null);

        // Clean up the buffers.
        // PI48725 Start
        // Handshake complete.  Now get the request.  Use our read interface so unwrap already done.
        // Check if data exists in the network buffer still.  This would be app data beyond handshake.
        if (netBuffer.remaining() == 0 || netBuffer.position() == 0) {
            // No app data.  Release the netBuffer as it will no longer be used.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Releasing netBuffer: " + netBuffer.hashCode());
            }
            // Null out the buffer references on the device side so they don't wrongly reused later.
            netBuffer.release();

        } else {
            // Found encrypted app data.  Don't release the network buffer yet.  Let the read decrypt it.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "App data exists in netBuffer after handshake: " + netBuffer.remaining());
            }
            this.readInterface.setNetBuffer(netBuffer);
        }
        // PI48725 Finish

        // Clean up the buffers.
        decryptedNetBuffer.release();
        encryptedAppBuffer.release();

        // Call appropriate callback if async
        if (async) {
            if (exception != null) {
                close(getVirtualConnection(), exception);
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Calling ready method.");
                }
                super.ready(getVirtualConnection());
            }
        } else {
            if (exception != null) {
                throw exception;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "readyOutboundPostHandshake");
        }
    }
protected void readyOutboundPostHandshake ( WsByteBuffer netBuffer , WsByteBuffer decryptedNetBuffer , WsByteBuffer encryptedAppBuffer , HandshakeStatus hsStatus , boolean async ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "readyOutboundPostHandshake, vc=" + getVCHash ( ) ) ; } IOException exception = null ; if ( hsStatus != HandshakeStatus . FINISHED ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected results of handshake after connect, " + hsStatus ) ; } exception = new IOException ( "Unexpected results of handshake after connect, " + hsStatus ) ; } getChannel ( ) . onHandshakeFinish ( getSSLEngine ( ) ) ; getDeviceReadInterface ( ) . setBuffers ( null ) ; if ( netBuffer . remaining ( ) == 0 || netBuffer . position ( ) == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Releasing netBuffer: " + netBuffer . hashCode ( ) ) ; } netBuffer . release ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "App data exists in netBuffer after handshake: " + netBuffer . remaining ( ) ) ; } this . readInterface . setNetBuffer ( netBuffer ) ; } decryptedNetBuffer . release ( ) ; encryptedAppBuffer . release ( ) ; if ( async ) { if ( exception != null ) { close ( getVirtualConnection ( ) , exception ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling ready method." ) ; } super . ready ( getVirtualConnection ( ) ) ; } } else { if ( exception != null ) { throw exception ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "readyOutboundPostHandshake" ) ; } }
This method is called to handle the results of an SSL handshake. This may be called
by a callback or in the same thread as the connect request.

@param netBuffer buffer for data flowing in fron the net
@param decryptedNetBuffer buffer for decrypted data from the net
@param encryptedAppBuffer buffer for encrypted data flowing from the app
@param hsStatus output from the last call to the SSL engine
@param async whether this is for an async (true) or sync (false) request
@throws IOException