Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active December 29, 2019 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gistlyn/f2e5b682262825d2dd35e76f445b7fa5 to your computer and use it in GitHub Desktop.
Save gistlyn/f2e5b682262825d2dd35e76f445b7fa5 to your computer and use it in GitHub Desktop.
C# Google protoc SSL ServiceStack GrpcServicesClient TodoWorld Example
using System;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using ServiceStack;
namespace TodoWorld
{
class Program
{
static async Task Main(string[] args)
{
var client = new GrpcServices.GrpcServicesClient(
GrpcServiceStack.Client("https://todoworld.servicestack.net:50051",
new X509Certificate2("grpc.crt"),
GrpcUtils.AllowSelfSignedCertificatesFrom("todoworld.servicestack.net")));
var response = await client.GetHelloAsync(new Hello { Name = "gRPC C#" });
Console.WriteLine(response.Result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment