Skip to content

Commit

Permalink
bind: add ca-file flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Jul 31, 2023
1 parent 072be21 commit 7f4d975
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions bind/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ func TLSClientConfig(fs *pflag.FlagSet, cfg *forwarder.TLSClientConfig) {
fs.BoolVar(&cfg.InsecureSkipVerify, "insecure", cfg.InsecureSkipVerify,
"Don't verify the server's certificate chain and host name. "+
"Enable to work with self-signed certificates. ")

fs.StringSliceVar(&cfg.CAFiles,
"ca-file", cfg.CAFiles, "<path or base64>"+
"Add your own CA certificates to verify against. "+
"The system root certificates will be used in addition to any certificates in this list. "+
"Can be a path to a file or \"data:\" followed by base64 encoded certificate. "+
"Use this flag multiple times to specify multiple CA certificate files. ")
}

func HTTPServerConfig(fs *pflag.FlagSet, cfg *forwarder.HTTPServerConfig, prefix string, schemes ...forwarder.Scheme) {
Expand Down
8 changes: 6 additions & 2 deletions cmd/forwarder/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ func rootCommand() *cobra.Command {
Prefix: []string{"dns"},
},
{
Name: "HTTP client options",
Prefix: []string{"http", "insecure"},
Name: "HTTP client options",
Prefix: []string{
"http",
"ca-file",
"insecure",
},
},
{
Name: "Logging options",
Expand Down

0 comments on commit 7f4d975

Please sign in to comment.