Esempio n. 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);
        }
Esempio n. 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);
        }