diff --git a/main.go b/main.go index 5a4c1e6..1684a72 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ var BaseDir string = "." var PMResponse string = "" var LogConnectionState bool var DebugMode bool +var VerifyTLS bool var CharacterMatcher *regexp.Regexp func init() { @@ -53,9 +54,10 @@ func LogMessage(hub, message string) { func HubWorker(addr, nick, password string) { opts := libnmdc.HubConnectionOptions{ - Address: libnmdc.HubAddress(addr), - Self: libnmdc.UserInfo{Nick: nick}, - NickPassword: password, + Address: libnmdc.HubAddress(addr), + SkipVerifyTLS: !VerifyTLS, + Self: libnmdc.UserInfo{Nick: nick}, + NickPassword: password, } hub := opts.Connect() @@ -104,6 +106,7 @@ func main() { flag.BoolVar(&LogConnectionState, "LogConnectionState", true, "Include connection state changes in log") flag.StringVar(&PMResponse, "PMResponse", "This is an automated service. For enquiries, please contact an administrator.", "Message to respond with on PM") flag.BoolVar(&DebugMode, "Debug", false, "Print additional information on stdout") + flag.BoolVar(&VerifyTLS, "VerifyTLS", true, "Verify TLS certificates") flag.Parse() // Assert dir exists