From 5743a4afe51de221beeeabe66552ae4d92eed1a6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 11 Jul 2022 16:10:28 +0200 Subject: [PATCH] fix: properly set tls config for mailer --- pkg/mail/mail.go | 8 +++++++- pkg/models/tasks.go | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/mail/mail.go b/pkg/mail/mail.go index cfb9b09e..2583efd4 100644 --- a/pkg/mail/mail.go +++ b/pkg/mail/mail.go @@ -18,6 +18,7 @@ package mail import ( "context" + "crypto/tls" "time" "code.vikunja.io/api/pkg/config" @@ -52,7 +53,12 @@ func getClient() (*mail.Client, error) { mail.WithUsername(config.MailerUsername.GetString()), mail.WithPassword(config.MailerPassword.GetString()), mail.WithPort(config.MailerPort.GetInt()), - mail.WithTLSPolicy(tlsPolicy)) + mail.WithTLSPolicy(tlsPolicy), + //#nosec G402 + mail.WithTLSConfig(&tls.Config{ + InsecureSkipVerify: config.MailerSkipTLSVerify.GetBool(), + }), + ) } // StartMailDaemon starts the mail daemon diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 090fe072..1dfc99ee 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -17,7 +17,6 @@ package models import ( - "github.com/google/uuid" "math" "regexp" "sort" @@ -25,15 +24,16 @@ import ( "strings" "time" - "github.com/jinzhu/copier" - "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/events" "code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/user" "code.vikunja.io/web" + + "github.com/google/uuid" "github.com/imdario/mergo" + "github.com/jinzhu/copier" "xorm.io/builder" "xorm.io/xorm" "xorm.io/xorm/schemas"