-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support tls config for webhook receiver #9341
Support tls config for webhook receiver #9341
Conversation
7b521f1
to
21aa6ea
Compare
go.sum
Outdated
github.com/grafana/dskit v0.0.0-20240826073544-47b1b6311db3 h1:fc4ORkqFiLzuCRD2wGmMXsyDTOLkcl3QUqQwjtAlKcE= | ||
github.com/grafana/dskit v0.0.0-20240826073544-47b1b6311db3/go.mod h1:wJbJeQ2ygiGuBKsur7BPPNe+3pSyHEDPtKa7IU3I8ZA= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to re-run go mod tidy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good now 👍
pkg/alertmanager/sender.go
Outdated
func tlsClient(tlsConfig *tls.Config) *http.Client { | ||
nc := func(tlsConfig *tls.Config) *http.Client { | ||
return &http.Client{ | ||
Timeout: time.Second * 30, | ||
Transport: &http.Transport{ | ||
TLSClientConfig: tlsConfig, | ||
Proxy: http.ProxyFromEnvironment, | ||
Dial: (&net.Dialer{ | ||
Timeout: 30 * time.Second, | ||
}).Dial, | ||
TLSHandshakeTimeout: 5 * time.Second, | ||
}, | ||
} | ||
} | ||
|
||
if tlsConfig == nil { | ||
return nc(&tls.Config{Renegotiation: tls.RenegotiateFreelyAsClient}) | ||
} | ||
|
||
return nc(tlsConfig) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is identical across grafana
and mimir
- can we extract it out into grafana/alerting
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - done now 👍
21aa6ea
to
7aaec9b
Compare
a5e125a
to
3ef6519
Compare
3ef6519
to
98b2a8f
Compare
Add TLS configuration support for webhook receivers
Related PR's