Flag to override server name when validating TLS cert (#20)
This commit is contained in:
parent
585cd1bae8
commit
f203c2cddf
|
|
@ -76,6 +76,7 @@ var (
|
|||
`When describing messages, show a JSON template for the message type.`)
|
||||
verbose = flag.Bool("v", false,
|
||||
`Enable verbose output.`)
|
||||
serverName = flag.String("servername", "", "Override servername when validating TLS certificate.")
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
@ -233,6 +234,9 @@ func main() {
|
|||
if err != nil {
|
||||
fail(err, "Failed to configure transport credentials")
|
||||
}
|
||||
if *serverName != "" {
|
||||
creds.OverrideServerName(*serverName)
|
||||
}
|
||||
}
|
||||
cc, err := grpcurl.BlockingDial(ctx, target, creds, opts...)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue