Пример #1
0
 protected virtual void CompleteHandshake()
 {
     try
     {
         mRecordStream.FinaliseHandshake();
         mSplitApplicationDataRecords = !TlsUtilities.IsTlsV11(Context);
         if (!mAppDataReady)
         {
             mAppDataReady = true;
             if (mBlocking)
             {
                 mTlsStream = new TlsStream(this);
             }
         }
         if (mTlsSession != null)
         {
             if (mSessionParameters == null)
             {
                 mSessionParameters = new SessionParameters.Builder().SetCipherSuite(mSecurityParameters.CipherSuite).SetCompressionAlgorithm(mSecurityParameters.CompressionAlgorithm).SetMasterSecret(mSecurityParameters.MasterSecret)
                                      .SetPeerCertificate(mPeerCertificate)
                                      .SetPskIdentity(mSecurityParameters.PskIdentity)
                                      .SetSrpIdentity(mSecurityParameters.SrpIdentity)
                                      .SetServerExtensions(mServerExtensions)
                                      .Build();
                 mTlsSession = new TlsSessionImpl(mTlsSession.SessionID, mSessionParameters);
             }
             ContextAdmin.SetResumableSession(mTlsSession);
         }
         Peer.NotifyHandshakeComplete();
     }
     finally
     {
         CleanupHandshake();
     }
 }