Skip to content
Snippets Groups Projects
Commit a87721a2 authored by Jonah Husson's avatar Jonah Husson
Browse files

Add noTLS flag to overwrite TLS info in NDF

parent 0180979e
No related branches found
No related tags found
No related merge requests found
......@@ -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 = ""
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment