-
Notifications
You must be signed in to change notification settings - Fork 512
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
Draft
titolins
wants to merge
2
commits into
main
Choose a base branch
from
titolins/support_tls_config_for_webhook_receiver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+171
−40
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 20, 2024
titolins
changed the title
Titolins/support tls config for webhook receiver
Support tls config for webhook receiver
Sep 20, 2024
titolins
commented
Sep 20, 2024
titolins
force-pushed
the
titolins/support_tls_config_for_webhook_receiver
branch
3 times, most recently
from
September 20, 2024 00:50
e232664
to
91ebee0
Compare
titolins
force-pushed
the
titolins/support_tls_config_for_webhook_receiver
branch
from
September 20, 2024 00:54
91ebee0
to
7b521f1
Compare
titolins
force-pushed
the
titolins/support_tls_config_for_webhook_receiver
branch
from
September 20, 2024 00:55
7b521f1
to
21aa6ea
Compare
titolins
requested review from
grafanabot,
a team and
stevesg
as code owners
September 20, 2024 00:59
fayzal-g
reviewed
Sep 20, 2024
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= |
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
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) | ||
} |
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
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add TLS configuration support for webhook receivers
Related PR's
Note