Browse Source

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

陈国伟 4 years ago
parent
commit
e158c0f4c1
1 changed files with 2 additions and 3 deletions
  1. 2 3
      FastGithub.Http/HttpClientHandler.cs

+ 2 - 3
FastGithub.Http/HttpClientHandler.cs

@@ -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)
                             {
                             {