Add basic amenities for implementing TLS
This commit is contained in:
parent
a0e4e5f12d
commit
824f52c80e
|
@ -27,6 +27,7 @@ var serverCmd = &cobra.Command{
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(serverCmd)
|
rootCmd.AddCommand(serverCmd)
|
||||||
serverCmd.PersistentFlags().StringP("clients", "c", "", "File to recover clients from")
|
serverCmd.PersistentFlags().StringP("clients", "c", "", "File to recover clients from")
|
||||||
|
serverCmd.Flags().Bool("insecure", false, "[UNSAFE] Do not use TLS encryption")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setServerParameters(cmd *cobra.Command) error {
|
func setServerParameters(cmd *cobra.Command) error {
|
||||||
|
@ -38,5 +39,9 @@ func setServerParameters(cmd *cobra.Command) error {
|
||||||
isUsingJSONParameter = true
|
isUsingJSONParameter = true
|
||||||
clientJSONPath = parameterClients
|
clientJSONPath = parameterClients
|
||||||
}
|
}
|
||||||
|
insecure, err := cmd.Flags().GetBool("insecure")
|
||||||
|
if insecure == true {
|
||||||
|
servInsecure = true
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ var (
|
||||||
|
|
||||||
heartbeatRate time.Duration = 15
|
heartbeatRate time.Duration = 15
|
||||||
|
|
||||||
|
servInsecure bool
|
||||||
|
|
||||||
isUsingJSONParameter bool
|
isUsingJSONParameter bool
|
||||||
clientJSONPath string = "/.config/tiamat/clients.json"
|
clientJSONPath string = "/.config/tiamat/clients.json"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue