小编zze*_*ell的帖子

gRPC 客户端无法使用 TLS 证书连接到服务器

我正在尝试使用 gRPC 与 TLS 证书建立加密连接。由于连接不安全,一切正常,我也尝试使用 Go 编写的客户端,它也能正常工作。但是使用 Python 我收到以下错误:

grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses"
        debug_error_string = "{"created":"@1565190346.229323178","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3528,"referenced_errors":
[{"created":"@1565190346.229314131","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":399,"grpc_status":14}]}"

Run Code Online (Sandbox Code Playgroud)

这是我客户的代码:

grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses"
        debug_error_string = "{"created":"@1565190346.229323178","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3528,"referenced_errors":
[{"created":"@1565190346.229314131","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":399,"grpc_status":14}]}"

Run Code Online (Sandbox Code Playgroud)

有什么建议?

更新

这是带有GRPC_TRACEGRPC_VERBOSITY环境变量的输出。

credentials = grpc.ssl_channel_credentials() …
Run Code Online (Sandbox Code Playgroud)

python ssl grpc

5
推荐指数
1
解决办法
4426
查看次数

引擎盖下的 Go 地图

在阅读了 Dave Cheney关于 Go 地图的博客文章后,我仍然有一些不清楚的地方。

域名注册地址:

  • 为什么它们是无序的?
  • 实际值存储在内存中的什么位置?

在挖掘运行时包后,我发现底层地图结构如下:

// A header for a Go map.
type hmap struct {
    // Note: the format of the hmap is also encoded in cmd/compile/internal/gc/reflect.go.
    // Make sure this stays in sync with the compiler's definition.
    count     int // # live cells == size of map.  Must be first (used by len() builtin)
    flags     uint8
    B         uint8  // log_2 of # of buckets (can hold up to loadFactor * …
Run Code Online (Sandbox Code Playgroud)

dictionary pointers hashmap go

5
推荐指数
1
解决办法
780
查看次数

标签 统计

dictionary ×1

go ×1

grpc ×1

hashmap ×1

pointers ×1

python ×1

ssl ×1