gRPC C#服务器身份验证 [英] gRPC C# Server authentication

查看:348
本文介绍了gRPC C#服务器身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用gRPC执行服务器身份验证,但是我不确定如何进行. 我当前的设置是,我在一台计算机上运行一台服务器,而另一台计算机(两台Windows计算机)上运行一个客户端. 为了进行测试,我使用Windows makecert.exe生成了一个证书颁发机构和一个私有证书(来自此证书颁发机构). 这将生成.cer文件.

I'm attempting to perform server authentication using gRPC however I'm unsure of how to proceed. My current setup is that I have a server running on one machine and a client on another (both windows machines). For testing purposes I've generated a certificate authority and a private certificate (from this certificate authority) using the windows makecert.exe. This generates .cer file.

SslServerCredentials的文档没有有关.cer文件的任何规定.在这种情况下,我的KeyCertificatePair是什么?该文档尚不清楚. http://www.grpc.io/grpc/csharp/html/T_Grpc_Core_SslServerCredentials. htm

The documentation for SslServerCredentials does not have any provisions for a .cer file. What would be my KeyCertificatePair in this case ? The documentation is unclear on this. http://www.grpc.io/grpc/csharp/html/T_Grpc_Core_SslServerCredentials.htm

此外,我只希望服务器对其自身进行身份验证,在客户端gRPC调用上是否需要任何特殊规定?

Also, I only want the server to authenticate itself, do I need any special provision on the client gRPC call?

推荐答案

您将同时需要一个私钥和cert文件.您可以看到gRPC测试代码如何实现

You'll need both a private key and the cert file. You can see how the gRPC testing code does it here.

这篇关于gRPC C#服务器身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆