diff --git a/model/notification.go b/model/notification.go index 51608f2..18ef495 100644 --- a/model/notification.go +++ b/model/notification.go @@ -110,15 +110,9 @@ func (n *Notification) setRequestHeader(req *http.Request) error { } func (ns *NotificationServerBundle) Send(message string) error { - var verifySSL bool + var client *http.Client n := ns.Notification if n.VerifySSL != nil && *n.VerifySSL { - verifySSL = true - } - - var client *http.Client - - if verifySSL { client = utils.HttpClient } else { client = utils.HttpClientSkipTlsVerify diff --git a/pkg/utils/http.go b/pkg/utils/http.go index 42c1091..6d9cc22 100644 --- a/pkg/utils/http.go +++ b/pkg/utils/http.go @@ -14,23 +14,23 @@ var ( func init() { HttpClientSkipTlsVerify = httpClient(_httpClient{ Transport: httpTransport(_httpTransport{ - VerifySSL: true, + SkipVerifySSL: true, }), }) HttpClient = httpClient(_httpClient{ Transport: httpTransport(_httpTransport{ - VerifySSL: false, + SkipVerifySSL: false, }), }) } type _httpTransport struct { - VerifySSL bool + SkipVerifySSL bool } func httpTransport(conf _httpTransport) *http.Transport { return &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.VerifySSL}, + TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.SkipVerifySSL}, Proxy: http.ProxyFromEnvironment, } }