mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
remove client pool and add tls client auth support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -12,29 +12,31 @@ var u = strings.ToUpper
|
||||
|
||||
func NewFlagSet() (*pflag.FlagSet, Option) {
|
||||
const (
|
||||
addr = "address"
|
||||
secure = "secure"
|
||||
// caCert = "ca-cert"
|
||||
// clientCert = "client-cert"
|
||||
// clientKey = "client-key"
|
||||
addr = "address"
|
||||
secure = "secure"
|
||||
caCert = "ca-cert"
|
||||
clientCert = "client-cert"
|
||||
clientKey = "client-key"
|
||||
)
|
||||
var (
|
||||
optAddress string
|
||||
optSecure bool
|
||||
// optCACert string
|
||||
// optCert string
|
||||
// optKey string
|
||||
optCACert string
|
||||
optCert string
|
||||
optKey string
|
||||
)
|
||||
flags := pflag.NewFlagSet("gRPC", pflag.ContinueOnError)
|
||||
flags.StringVar(&optAddress, addr, env.GetDefault(u(addr), "0.0.0.0:0"), "Bind address for the server. 127.0.0.1:9090"+flagEnv(addr))
|
||||
flags.BoolVar(&optSecure, secure, env.GetBoolDefault(u(secure), true), "Generate self signed certificate if none provided"+flagEnv(secure))
|
||||
// flags.StringVar(&optCACert, caCert, "", "Path to Root CA certificate"+flagEnv(optCACert))
|
||||
// flags.StringVar(&optCert, clientCert, "", "Path to Server certificate"+flagEnv(clientCert))
|
||||
// flags.StringVar(&optKey, clientKey, "", "Path to Server key"+flagEnv(clientKey))
|
||||
flags.StringVar(&optCACert, caCert, "", "Path to Root CA certificate"+flagEnv(optCACert))
|
||||
flags.StringVar(&optCert, clientCert, "", "Path to Server certificate"+flagEnv(clientCert))
|
||||
flags.StringVar(&optKey, clientKey, "", "Path to Server key"+flagEnv(clientKey))
|
||||
return flags, func(o *options) {
|
||||
o.addr = optAddress
|
||||
o.secure = optSecure
|
||||
|
||||
o.caCert = optCACert
|
||||
o.cert = optCert
|
||||
o.key = optKey
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user