ruby - grpc server ruby with TLS/SSL
问题描述
I am trying to implement a secure gRPC TLS connection between a ruby client and a ruby server. I am unable to figure out how to configure the server to use the secure connection.
In production, our server is implemented in Go. However, we have been unable to connect to it from ruby by anything other than an insecure connection. I have been tasked with creating a reference TLS connection to show a secure connection from a ruby client will work.
I have the grpc quickstart example greeter working for ruby as an insecure connection.
In the gRPC authentication documentation the Go example replaces this
s := grpc.NewServer()
with this
creds, _ := credentials.NewServerTLSFromFile(certFile, keyFile)
s := grpc.NewServer(grpc.Creds(creds))
for ruby there is this in the quickstart greeter app
s = GRPC::RpcServer.new
but I have been unable to find how to create a secure server.
The requirements include that we must have the server validate the client's public key as trusted in order to allow access to the server. (The client will also need to trust the server's public key to validate the server.)
解决方案
I've not used Ruby w/ gRPC but am familiar with the Golang SDK.
See here for what appears to be a Ruby gRPC server w/ TLS:
推荐阅读
- python - 将包数据设置为 PyPI python 包中命令行参数的默认输入
- .htaccess - 使用指向 page.php 的 1 个参数编写干净的 URL
- python - PySpark:对象长度与字段长度不匹配 - 创建新模式
- python - PermissionError: [Errno 13] Permission denied: '/home/ceyedev/.aws' while running docker-compose up
- python - 如何将文本框中输入的值从 django 以文本格式传递给烧瓶?
- mongodb - Mongo DB Facets 查询和过滤器
- javascript - 如何仅以角度形式获取有效表单字段的值
- css - 我想让我的字体比它们更平滑
- asp.net-core - 如何在配置文件中分配 API URL 的基本路径?
- nginx - 构建时间问题后从公用文件夹提供 next.js 静态资产