diff --git a/cmd/root.go b/cmd/root.go index 671e8aefb280cb1f33f0fe77f978ff96206ca1ae..81c70a8cb52c72629a96a74fa9890c62e58265c7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -56,6 +56,7 @@ var skipNDFVerification bool var ndfRegistration []string var ndfUDB []string var ndfPubKey string +var noTLS bool // Execute adds all child commands to the root command and sets flags // appropriately. This is called by main.main(). It only needs to @@ -594,6 +595,9 @@ func init() { rootCmd.PersistentFlags().StringSliceVarP(&keyParams, "keyParams", "", make([]string, 0), "Define key generation parameters. Pass values in comma separated list"+ " in the following order: MinKeys,MaxKeys,NumRekeys,TTLScalar,MinNumKeys") + + rootCmd.Flags().BoolVarP(&noTLS, "noTLS", "", false, + "Set to ignore TLS") } // initConfig reads in config file and ENV variables if set. @@ -648,4 +652,14 @@ func overwriteNDF(n *ndf.NetworkDefinition) { globals.Log.WARN.Println("Overwrote UDB values in the " + "NetworkDefinition from the commandline") } + + if noTLS { + for i := 0; i < len(n.Nodes); i++ { + n.Nodes[i].TlsCertificate = "" + } + n.Registration.TlsCertificate = "" + for i := 0; i < len(n.Gateways); i++ { + n.Gateways[i].TlsCertificate = "" + } + } }