support RpcClient Vertify With Unilateralism and Mutual (#647)

Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
workman-Lu
2021-10-30 22:07:15 +08:00
committed by GitHub
parent bef5bd4e4f
commit 9df6786b09
5 changed files with 69 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ type (
Token string `json:",optional"`
Retry bool `json:",optional"` // grpc auto retry
Timeout int64 `json:",default=2000"`
InsecureVerify bool `json:",default=false"`
}
)
@@ -72,3 +73,8 @@ func (sc RpcServerConf) Validate() error {
func (cc RpcClientConf) HasCredential() bool {
return len(cc.App) > 0 && len(cc.Token) > 0
}
//HasTls checks if there is a SSL in config.
func (cc RpcClientConf) HasSslVerify() bool {
return cc.InsecureVerify
}