示例#1
0
        public async Task <bool> AuthorizeAsync(X509Certificate certificate)
        {
            if (IsProtected)
            {
                return(true);
            }

            try
            {
                await ReadWriteSslStream.AuthenticateAsServerAsync(certificate, false, SslProtocols.Tls12, false);
            }
            catch (AuthenticationException)
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        public bool Authorize(X509Certificate certificate)
        {
            if (IsProtected)
            {
                return(true);
            }

            try
            {
                ReadWriteSslStream.AuthenticateAsServer(certificate, false, SslProtocols.Tls12, false);
            }
            catch (AuthenticationException)
            {
                return(false);
            }

            return(true);
        }