Fix nullable annotations on DangerousAcceptAnyServerCertificateValidator (#36305)
authorStephen Toub <stoub@microsoft.com>
Tue, 12 May 2020 22:48:53 +0000 (18:48 -0400)
committerGitHub <noreply@github.com>
Tue, 12 May 2020 22:48:53 +0000 (18:48 -0400)
It should match ServerCertificateCustomValidationCallback.

src/libraries/System.Net.Http/ref/System.Net.Http.cs
src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs

index 3026fa779ab0db6e5bcb7e8269c90a903e1c54be..91d4676d3ab9984063981e7fcfb819086cded368 100644 (file)
@@ -99,7 +99,7 @@ namespace System.Net.Http
         public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get { throw null; } }
         public System.Net.CookieContainer CookieContainer { get { throw null; } set { } }
         public System.Net.ICredentials? Credentials { get { throw null; } set { } }
-        public static System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get { throw null; } }
+        public static System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2?, System.Security.Cryptography.X509Certificates.X509Chain?, System.Net.Security.SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get { throw null; } }
         public System.Net.ICredentials? DefaultProxyCredentials { get { throw null; } set { } }
         public int MaxAutomaticRedirections { get { throw null; } set { } }
         public int MaxConnectionsPerServer { get { throw null; } set { } }
index 1851c5aa3da6aa6f030f16bca1be6adae3a33fcb..304b810d548742971d9b0ad6f778a28bb73a0375 100644 (file)
@@ -222,7 +222,7 @@ namespace System.Net.Http
                 _socketsHttpHandler.SendAsync(request, cancellationToken);
         }
 
-        public static Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get; } = delegate { return true; };
+        public static Func<HttpRequestMessage, X509Certificate2?, X509Chain?, SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get; } = delegate { return true; };
 
         private void ThrowForModifiedManagedSslOptionsIfStarted()
         {