Grpc now ignore the CA as well

This commit is contained in:
2025-07-20 18:11:22 +08:00
parent 7a0aeccd9a
commit ee3197f210

View File

@@ -21,6 +21,8 @@ public static class GrpcClientHelper
? X509Certificate2.CreateFromPemFile(clientCertPath, clientKeyPath)
: X509Certificate2.CreateFromEncryptedPemFile(clientCertPath, clientCertPassword, clientKeyPath)
);
// TODO: Verify the ca in the future
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true;
var httpClient = new HttpClient(handler);
httpClient.DefaultRequestVersion = HttpVersion.Version20;
httpClient.DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher;