Skip to content

Commit

Permalink
Add hostname-override flag to root command to support overriding SNI …
Browse files Browse the repository at this point in the history
…hostname
  • Loading branch information
jwineinger committed Nov 22, 2023
1 parent 7942023 commit 9d7bf5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,10 @@ func DialOptsFromFlags(cmd *cobra.Command, token storage.Token) ([]grpc.DialOpti
opts = append(opts, certOpt)
}

hostnameOverride := cobrautil.MustGetString(cmd, "hostname-override")
if hostnameOverride != "" {
opts = append(opts, grpc.WithAuthority(hostnameOverride))
}

return opts, nil
}
1 change: 1 addition & 0 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func Run() {

rootCmd.PersistentFlags().String("endpoint", "", "spicedb gRPC API endpoint")
rootCmd.PersistentFlags().String("permissions-system", "", "permissions system to query")
rootCmd.PersistentFlags().String("hostname-override", "", "override the hostname used in the connection to the endpoint")
rootCmd.PersistentFlags().String("token", "", "token used to authenticate to SpiceDB")
rootCmd.PersistentFlags().String("certificate-path", "", "path to certificate authoriy used to verify secure connections")
rootCmd.PersistentFlags().Bool("insecure", false, "connect over a plaintext connection")
Expand Down

0 comments on commit 9d7bf5f

Please sign in to comment.