修复linux下TlsIgnoreNameMismatch可能无效的问题

This commit is contained in:
陈国伟 2021-08-18 14:22:52 +08:00
parent 78bf276468
commit e158c0f4c1

View File

@ -1,5 +1,4 @@
using FastGithub.Configuration; using FastGithub.DomainResolve;
using FastGithub.DomainResolve;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@ -125,7 +124,7 @@ namespace FastGithub.Http
bool ValidateServerCertificate(object sender, X509Certificate? cert, X509Chain? chain, SslPolicyErrors errors) bool ValidateServerCertificate(object sender, X509Certificate? cert, X509Chain? chain, SslPolicyErrors errors)
{ {
if (errors == SslPolicyErrors.RemoteCertificateNameMismatch) if (errors.HasFlag(SslPolicyErrors.RemoteCertificateNameMismatch))
{ {
if (this.domainConfig.TlsIgnoreNameMismatch == true) if (this.domainConfig.TlsIgnoreNameMismatch == true)
{ {