gRPC SSL communication for .NET Framework to .NET Core Server.

107 views
Skip to first unread message

poulos...@gmail.com

unread,
Jul 22, 2020, 8:41:31 AM7/22/20
to grpc.io
The Question in short is 
Can I use C# Full .NET Framework Client with  C# .NET core client with a secured Channel.?
Can you lead me to some examples where this is done? I could not find anywhere if this can be  done or It Cannot be done.

Detail:
I made an example using .NET Framework client with Grpc C# Github as the reference and .NET Core client with this example from Grpc dotnet as a the reference.
I was able to establish an insecure communication channel with 
new Channel("127.0.0.1", 5000, ChannelCredentials.Insecure)
and the Non-Https port opened in 5000 in the ASP.NET Core server.

When I try to connect with  
var channel = new Channel("127.0.0.1", 5001, new SslCredentials());
to the Https port 5000 in the ASP.NET Core ServerI

How can I use a secure channel to communicate. I want to use the same pfx + password combination.

Jan Tattermusch

unread,
Jul 23, 2020, 7:47:17 AM7/23/20
to grpc.io
The client needs to use trust roots that match to the certificate that's used by the server.
new SslCredentials() will use the default roots.pem which will only work for public servers that have a certificate signed by a renowned certificate authority (which very likely isn't your case).
So you'll need to specify "roots.pem" that match your server's pfx.

Some examples:

Additional useful resources are here:
Reply all
Reply to author
Forward
0 new messages