fix(notifications): always verify Telegram certificate (#893)

This commit is contained in:
Yuchen Ying 2023-04-30 18:00:33 -07:00 committed by GitHub
parent 64900c4d56
commit 82a117c12b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@ package notification
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"html"
@ -60,13 +59,7 @@ func (s *telegramSender) Send(event domain.NotificationEvent, payload domain.Not
req.Header.Set("Content-Type", "application/json")
//req.Header.Set("User-Agent", "autobrr")
t := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
client := http.Client{Transport: t, Timeout: 30 * time.Second}
client := http.Client{Timeout: 30 * time.Second}
res, err := client.Do(req)
if err != nil {
s.log.Error().Err(err).Msgf("telegram client request error: %v", event)