diff options
Diffstat (limited to 'modules/mailer/mailer.go')
-rw-r--r-- | modules/mailer/mailer.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index fc6ec2fa86..74a3fca578 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -78,6 +78,14 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) ServerName: host, } + if settings.UseCertificate { + cert, err := tls.LoadX509KeyPair(settings.CertFile, settings.KeyFile) + if err != nil { + return err + } + tlsconfig.Certificates = []tls.Certificate{cert} + } + conn, err := net.Dial("tcp", net.JoinHostPort(host, port)) if err != nil { return err |