admin管理员组文章数量:1305157
I'm trying to establish connection between client and server using grpc. I'm doing the .proto file approach. I have couple of questions on this.
- Does grpc only have to run with HTTPS?
- Doeschat.proto files for both the client and server should be identical? Even the C# namespace?
I'm trying to establish connection between client and server using grpc. I'm doing the .proto file approach. I have couple of questions on this.
- Does grpc only have to run with HTTPS?
- Doeschat.proto files for both the client and server should be identical? Even the C# namespace?
- TLS (HTTPS) is preferred and often the default when using gRPC but it's not a requirement. I'm unsure which language implementations permit using non-TLS aka "insecure" (also h2c) but Go and Rust do support insecure. Protobuf files use namespaces for the Proto resources (e.g. Messages, Services) but the protobuf namespaces aren't directly represented in language implementations (probably to avoid the complexity that would result). That said, you should share compiled "stubs" between clients and servers (including the e.g. C# namespace). – DazWilkin Commented Feb 3 at 21:35
1 Answer
Reset to default 0GRPC can run without HTTPS in ASP.NET from the server side. It can also run without TLS on the client.
In your kestrel config you can do the following to force it to run without TLS on a specific port:
builder.WebHost.UseKestrel(x =>
{
x.ListenAnyIP(18940, options =>
{
options.Protocols = HttpProtocols.Http2;
}
}
For the client according to the code in my current project, no special configuration is needed.
As for the models, the namespace should match on the .proto file. I recommend building the shared proto models in a shared class library.
本文标签: authenticationNeed help to fix communication using GRPCbetween client and serverStack Overflow
版权声明:本文标题:authentication - Need help to fix communication using GRPC - between client and server - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741797981a2398051.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论