Add basic amenities for implementing TLS

This commit is contained in:
raul 2024-07-02 20:19:56 +02:00
parent a0e4e5f12d
commit 824f52c80e
2 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,7 @@ var serverCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(serverCmd)
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 {
@ -38,5 +39,9 @@ func setServerParameters(cmd *cobra.Command) error {
isUsingJSONParameter = true
clientJSONPath = parameterClients
}
insecure, err := cmd.Flags().GetBool("insecure")
if insecure == true {
servInsecure = true
}
return nil
}

View File

@ -21,6 +21,8 @@ var (
heartbeatRate time.Duration = 15
servInsecure bool
isUsingJSONParameter bool
clientJSONPath string = "/.config/tiamat/clients.json"
)