Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Comments

Add support for passing path to custom TLS CA cert & client key/cert …#207

Merged
prymitive merged 6 commits intomasterfrom
tls-auth
Jan 24, 2018
Merged

Add support for passing path to custom TLS CA cert & client key/cert …#207
prymitive merged 6 commits intomasterfrom
tls-auth

Conversation

@prymitive
Copy link
Contributor

…pair

Fixes #184

@prymitive prymitive force-pushed the tls-auth branch 2 times, most recently from 489d902 to c4c28e2 Compare January 9, 2018 03:06
Note that this option requires `tls:key` to be also set.
* `tls:key` - path to a TLS client key file to use when establishing
TLS connections to this Alertmanager instance.
Note that this option requires `tls:key` to be also set.

Choose a reason for hiding this comment

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

tls:cert. also might be worth being clear these are optional, even if tls:ca is set.


start := time.Now()
silences, err := mapper.GetSilences(am.URI, am.RequestTimeout)
silences, err := mapper.GetSilences(am.URI, am.RequestTimeout, am.TLSConfig)

Choose a reason for hiding this comment

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

Why are you having to thread TLSConfig? I'd expect the transport to be allocated (with the TLS config) when the AM was added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that's not great, refactored to pass around tls.Config instead
anything else stands out here?

Copy link

@terinjokes terinjokes left a comment

Choose a reason for hiding this comment

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

In addition to what we talked about in our in-person code review.

// WithTLSConfig option can be passed to NewAlertmanager in order to set
// custom options for the TLS handling when sending requests to Alertmanager
// upstream
func WithTLSConfig(tlsOptions transport.TLSConnectionOptions) Option {

Choose a reason for hiding this comment

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

Either rename this function to WithTLSOptions or similar or do this work to turn the YAML options into a standard tls.Config and pass that here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'm gonna go with dedicated option for setting CA certs and client cert/key

@prymitive prymitive added this to the v0.9 milestone Jan 20, 2018
…pair

This adds support for passing a custom http.RoundTripper so in effect we can customize TLS client config for HTTPS requests.
Fixes #184
There's identical method on the Alertmanager instance that's being used
This package adds handlers for different URI schemes, name clashes with http.Transport which is now passed around. Rename it to make it more obvious what it does
@prymitive
Copy link
Contributor Author

@terinjokes please review latest version, with previous refactoring this is now a smaller
there's some extra noise due to renaming of transport package, I felt it was needed since http.Transport is now passed (rather than just tls.Config) and having 2 "transports" passed around was too confusing

When we proxy requests we should use same transport as we use when collecting alerts & silences
@prymitive prymitive merged commit 0d228d2 into master Jan 24, 2018
@prymitive prymitive deleted the tls-auth branch January 24, 2018 20:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants