@@ -19,7 +19,6 @@ package notifier
1919import  (
2020	"context" 
2121	"crypto/tls" 
22- 	"crypto/x509" 
2322	"fmt" 
2423	"net/http" 
2524	"net/url" 
@@ -41,7 +40,7 @@ type DataDog struct {
4140// url: The DataDog API endpoint to use. Examples: https://api.datadoghq.com, https://api.datadoghq.eu, etc. 
4241// token: The DataDog API key (not the application key). 
4342// headers: A map of extra tags to add to the event 
44- func  NewDataDog (address  string , proxyUrl  string , certPool   * x509. CertPool , token  string ) (* DataDog , error ) {
43+ func  NewDataDog (address  string , proxyUrl  string , tlsConfig   * tls. Config , token  string ) (* DataDog , error ) {
4544	conf  :=  datadog .NewConfiguration ()
4645
4746	if  token  ==  ""  {
@@ -56,7 +55,7 @@ func NewDataDog(address string, proxyUrl string, certPool *x509.CertPool, token
5655	conf .Host  =  baseUrl .Host 
5756	conf .Scheme  =  baseUrl .Scheme 
5857
59- 	if  proxyUrl  !=  ""  ||  certPool  !=  nil  {
58+ 	if  proxyUrl  !=  ""  ||  tlsConfig  !=  nil  {
6059		transport  :=  & http.Transport {}
6160
6261		if  proxyUrl  !=  ""  {
@@ -68,10 +67,8 @@ func NewDataDog(address string, proxyUrl string, certPool *x509.CertPool, token
6867			transport .Proxy  =  http .ProxyURL (proxy )
6968		}
7069
71- 		if  certPool  !=  nil  {
72- 			transport .TLSClientConfig  =  & tls.Config {
73- 				RootCAs : certPool ,
74- 			}
70+ 		if  tlsConfig  !=  nil  {
71+ 			transport .TLSClientConfig  =  tlsConfig 
7572		}
7673
7774		conf .HTTPClient  =  & http.Client {
0 commit comments