@@ -9,33 +9,46 @@ package namespace
99import (
1010 "io"
1111
12+ "github.com/hyperledger/fabric-x-common/cmd/common/comm"
13+
1214 "github.com/spf13/cobra"
1315)
1416
15- type listFunc func (out io.Writer , endpoint , cacert string ) error
17+ type listFunc func (out io.Writer , endpoint string , tlsConfig comm. Config ) error
1618
1719func newListCommand (listFunc listFunc ) * cobra.Command {
1820 // this is our default query service endpoint
1921 endpoint := "localhost:7001"
20- cacert := ""
22+ var tlsConfig comm. Config
2123
2224 cmd := & cobra.Command {
2325 Use : "list" ,
2426 Short : "List installed Namespaces" ,
2527 Long : "" ,
2628 RunE : func (cmd * cobra.Command , _ []string ) error {
27- return listFunc (cmd .OutOrStdout (), endpoint , cacert )
29+ return listFunc (cmd .OutOrStdout (), endpoint , tlsConfig )
2830 },
2931 }
3032
31- cmd .PersistentFlags ().StringVarP (& cacert ,
33+ cmd .PersistentFlags ().StringVarP (& tlsConfig . PeerCACertPath ,
3234 "cafile" ,
3335 "" ,
3436 "" ,
35- "Path to file containing PEM-encoded trusted certificate(s) for the committer query service endpoint " ,
37+ "Path to file containing PEM-encoded trusted certificate(s) for the committer" ,
3638 )
3739
38- // TODO: add client crt / key for mTLS support
40+ cmd .PersistentFlags ().StringVarP (& tlsConfig .KeyPath ,
41+ "keyfile" ,
42+ "" ,
43+ "" ,
44+ "Path to file containing PEM-encoded private key to use for mutual TLS communication with the committer" ,
45+ )
46+ cmd .PersistentFlags ().StringVarP (& tlsConfig .CertPath ,
47+ "certfile" ,
48+ "" ,
49+ "" ,
50+ "Path to file containing PEM-encoded public key to use for mutual TLS communication with the committer" ,
51+ )
3952
4053 cmd .PersistentFlags ().StringVar (
4154 & endpoint ,
0 commit comments