pf-dtm

command module
v1.17.0-tls Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

README

Fork 元との差分、及び、意図

gRPC で https が使えない

Dial 時のオプションが http ( HTTP/1.1 ) 用に固定されているため https ( HTTP/2 ) を始めとする TLS 通信だと利用できない

元コードの該当箇所 ( 23.05.18 時点 )

inOpt := grpc.WithChainUnaryInterceptor(interceptors...)
conn, rerr := grpc.Dial(grpcServer, inOpt, grpc.WithTransportCredentials(insecure.NewCredentials()), opts)

そのため、dtmconn パッケージに Dial 関数を実装した内部的には環境変数 GRPC_INSECURE で切り替えられるようにした上で、以下のように修正した

inOpt := grpc.WithChainUnaryInterceptor(interceptors...)
conn, rerr := dtmconn.Dial(grpcServer, inOpt, opts)

なお、セキュリティ上、デフォルトは https としている

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL