protected void readyInboundPostHandshake ( WsByteBuffer netBuffer , WsByteBuffer decryptedNetBuffer , WsByteBuffer encryptedAppBuffer , HandshakeStatus hsStatus ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "readyInboundPostHandshake, vc=" + getVCHash ( ) ) ; } // Release the no longer needed buffers. encryptedAppBuffer . release ( ) ; if ( hsStatus == HandshakeStatus . FINISHED ) { AlpnSupportUtils . getAlpnResult ( getSSLEngine ( ) , this ) ; // PK16095 - take certain actions when the handshake completes getChannel ( ) . onHandshakeFinish ( getSSLEngine ( ) ) ; // 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 ( ) ) ; } netBuffer . release ( ) ; getDeviceReadInterface ( ) . setBuffers ( null ) ; } 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 ( ) ) ; } } readInterface . setBuffer ( decryptedNetBuffer ) ; // No need to save number of bytes read. MyReadCompletedCallback readCallback = new MyReadCompletedCallback ( decryptedNetBuffer ) ; if ( null != readInterface . read ( 1 , readCallback , false , TCPRequestContext . USE_CHANNEL_TIMEOUT ) ) { // Read was handled synchronously. determineNextChannel ( ) ; } } else { // Unknown result from handshake. All other results should have thrown exceptions. // Clean up buffers used during read. netBuffer . release ( ) ; getDeviceReadInterface ( ) . setBuffers ( null ) ; decryptedNetBuffer . release ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unhandled result from SSL engine: " + hsStatus ) ; } SSLException ssle = new SSLException ( "Unhandled result from SSL engine: " + hsStatus ) ; FFDCFilter . processException ( ssle , getClass ( ) . getName ( ) , "401" , this ) ; close ( getVirtualConnection ( ) , ssle ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "readyInboundPostHandshake" ) ; } }
This method is called after the SSL handshake has taken place .