Skip to content
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

Merged
merged 7 commits into from
Oct 22, 2024

Conversation

titolins
Copy link
Contributor

@titolins titolins commented Sep 20, 2024

@titolins titolins changed the title Titolins/support tls config for webhook receiver Support tls config for webhook receiver Sep 20, 2024
go.mod Outdated Show resolved Hide resolved
@titolins titolins force-pushed the titolins/support_tls_config_for_webhook_receiver branch 5 times, most recently from 7b521f1 to 21aa6ea Compare September 20, 2024 00:55
@titolins titolins marked this pull request as ready for review September 20, 2024 00:59
@titolins titolins marked this pull request as draft September 20, 2024 09:55
go.sum Outdated
Comment on lines 1262 to 1263
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=
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be good now 👍

Comment on lines 105 to 125
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)
}
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - done now 👍

@titolins titolins force-pushed the titolins/support_tls_config_for_webhook_receiver branch from 21aa6ea to 7aaec9b Compare October 17, 2024 09:28
@titolins titolins marked this pull request as ready for review October 17, 2024 09:50
@titolins titolins force-pushed the titolins/support_tls_config_for_webhook_receiver branch from a5e125a to 3ef6519 Compare October 21, 2024 12:54
@titolins titolins force-pushed the titolins/support_tls_config_for_webhook_receiver branch from 3ef6519 to 98b2a8f Compare October 22, 2024 10:20
@fayzal-g fayzal-g merged commit 8fa5f44 into main Oct 22, 2024
29 checks passed
@fayzal-g fayzal-g deleted the titolins/support_tls_config_for_webhook_receiver branch October 22, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants