Files
Swarm/DysonNetwork.Shared/Proto/GrpcClientHelper.cs
2025-09-21 20:20:31 +08:00

18 lines
506 B
C#

using System.Net;
using Grpc.Net.Client;
using System.Security.Cryptography.X509Certificates;
using Grpc.Core;
namespace DysonNetwork.Shared.Proto;
public static class GrpcClientHelper
{
public static CallInvoker CreateCallInvoker(string url)
{
return GrpcChannel.ForAddress(url, new GrpcChannelOptions
{
HttpHandler = new HttpClientHandler()
{ ServerCertificateCustomValidationCallback = (_, _, _, _) => true },
}).CreateCallInvoker();
}
}