You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何配置为Insecure的Cloud Run gRPC服务器可接受createSsl客户端连接?

关于Cloud Run上gRPC服务客户端与服务端证书配置的疑问

我在Google Cloud Run上部署了一个gRPC服务器,对背后的运行原理存在疑惑,希望得到相关指导。

服务端配置(server.js)

server.bindAsync(`0.0.0.0:${process.env.PORT}`, grpc.ServerCredentials.createInsecure(), () => { // 注意:此处使用的是不安全配置
    server.start();
    console.log('GRPC Service Started');
});

服务访问地址:test-service-abcdefghij-ue.a.run.app

客户端连接代码(client.js)

... new test_proto.TestAccount("test-service-abcdefghij-ue.a.run.app", grpc.credentials.createSsl()); // 注意:我使用了createSsl而非createInsecure()

我原本以为服务端和客户端必须使用匹配的自签名证书才能正常建立连接,但现在客户端使用了createSsl()且未传入自签名证书,却成功连接到了配置为createInsecure()的服务端。我对此感到困惑:

  • 这种情况为什么能正常工作?
  • 这是否意味着数据仍以明文形式传输?

内容的提问来源于stack exchange,提问作者ololo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 06:25:27