static void OnAuthenticateAsClient(IAsyncResult result)
        {
            if (result.CompletedSynchronously)
            {
                return;
            }

            StreamSecurityUpgradeInitiatorAsyncResult thisPtr =
                (StreamSecurityUpgradeInitiatorAsyncResult)result.AsyncState;

            Exception completionException = null;

            try
            {
                thisPtr.CompleteAuthenticateAsClient(result);
            }
#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                completionException = e;
            }
            thisPtr.Complete(false, completionException);
        }
        public static Stream End(IAsyncResult result, out SecurityMessageProperty remoteSecurity)
        {
            StreamSecurityUpgradeInitiatorAsyncResult thisPtr = AsyncResult.End <StreamSecurityUpgradeInitiatorAsyncResult>(result);

            remoteSecurity = thisPtr.remoteSecurity;
            return(thisPtr.upgradedStream);
        }
            public static Stream End(IAsyncResult result, out SecurityMessageProperty remoteSecurity, out ChannelBinding channelBinding)
            {
                Stream stream = StreamSecurityUpgradeInitiatorAsyncResult.End(result, out remoteSecurity);

                channelBinding = ((SslStreamSecurityUpgradeInitiator.InitiateUpgradeAsyncResult)result).channelBindingToken;
                return(stream);
            }
Beispiel #4
0
 private static void OnAuthenticateAsClient(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         StreamSecurityUpgradeInitiatorAsyncResult asyncState = (StreamSecurityUpgradeInitiatorAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.CompleteAuthenticateAsClient(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }
 protected override Stream OnEndInitiateUpgrade(IAsyncResult result, out SecurityMessageProperty remoteSecurity)
 {
     return(StreamSecurityUpgradeInitiatorAsyncResult.End(result, out remoteSecurity));
 }