예제 #1
0
        private static bool ConfirmServerCertificate(Session oS, string sExpectedCN, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            CertificateValidity oValidity = CertificateValidity.Default;

            KProxyApplication.CheckOverrideCertificatePolicy(oS, sExpectedCN, certificate, chain, sslPolicyErrors, ref oValidity);
            switch (oValidity)
            {
            case CertificateValidity.ForceInvalid:
                return(false);

            case CertificateValidity.ForceValid:
                return(true);
            }
            if ((oValidity == CertificateValidity.ConfirmWithUser) || ((sslPolicyErrors != SslPolicyErrors.None) && !KPCONFIG.IgnoreServerCertErrors))
            {
                return(false);
            }
            return(true);
        }