/// <summary> /// /// </summary> /// <param name="dh"></param> /// <param name="enabledSslProtocols"></param> /// <param name="sslStrength"></param> /// <param name="asyncCallback"></param> /// <param name="asyncState"></param> /// <returns></returns> public virtual IAsyncResult BeginAuthenticateAsServer( DH dh, SslProtocols enabledSslProtocols, SslStrength sslStrength, AsyncCallback asyncCallback, Object asyncState) { if (IsAuthenticated) { throw new InvalidOperationException("SslStream is already authenticated"); } // Initialize the server stream SslAnonStreamServer server_stream = new SslAnonStreamServer(InnerStream, false, dh, enabledSslProtocols, sslStrength); // Set the internal sslStream sslStream = server_stream; // Start the read operation return(BeginRead(new byte[0], 0, 0, asyncCallback, asyncState)); }
/// <summary> /// /// </summary> /// <param name="dh"></param> /// <param name="enabledSslProtocols"></param> /// <param name="sslStrength"></param> /// <param name="asyncCallback"></param> /// <param name="asyncState"></param> /// <returns></returns> public virtual IAsyncResult BeginAuthenticateAsServer( DH dh, SslProtocols enabledSslProtocols, SslStrength sslStrength, AsyncCallback asyncCallback, Object asyncState) { if (IsAuthenticated) { throw new InvalidOperationException("SslStream is already authenticated"); } // Initialize the server stream SslAnonStreamServer server_stream = new SslAnonStreamServer(InnerStream, false, dh, enabledSslProtocols, sslStrength); // Set the internal sslStream sslStream = server_stream; // Start the read operation return BeginRead(new byte[0], 0, 0, asyncCallback, asyncState); }