Ejemplo n.º 1
0
        public bool InvokeSystemValidator(string targetHost, bool serverMode, XX509CertificateCollection certificates, XX509Chain xchain, ref MonoSslPolicyErrors xerrors, ref int status11)
        {
            X509Chain chain  = (X509Chain)(object)xchain;
            var       errors = (SslPolicyErrors)xerrors;
            var       result = SystemCertificateValidator.Evaluate(settings, targetHost, certificates, chain, ref errors, ref status11);

            xerrors = (MonoSslPolicyErrors)errors;
            return(result);
        }
Ejemplo n.º 2
0
 public ValidationResult ValidateCertificate(string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
 {
     try {
         var chain  = (X509Chain)(object)xchain;
         var result = ValidateChain(host, serverMode, leaf, chain, null, 0);
         if (tlsStream != null)
         {
             tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
         }
         return(result);
     } catch {
         if (tlsStream != null)
         {
             tlsStream.CertificateValidationFailed = true;
         }
         throw;
     }
 }
Ejemplo n.º 3
0
		public bool InvokeSystemValidator (string targetHost, bool serverMode, XX509CertificateCollection certificates, XX509Chain xchain, ref MonoSslPolicyErrors xerrors, ref int status11)
		{
			X509Chain chain = (X509Chain)(object)xchain;
			var errors = (SslPolicyErrors)xerrors;
			var result = SystemCertificateValidator.Evaluate (settings, targetHost, certificates, chain, ref errors, ref status11);
			xerrors = (MonoSslPolicyErrors)errors;
			return result;
		}
Ejemplo n.º 4
0
		public ValidationResult ValidateCertificate (string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
		{
			try {
				var chain = (X509Chain)(object)xchain;
				var result = ValidateChain (host, serverMode, leaf, chain, null, 0);
				if (tlsStream != null)
					tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
				return result;
			} catch {
				if (tlsStream != null)
					tlsStream.CertificateValidationFailed = true;
				throw;
			}
		}