-
Notifications
You must be signed in to change notification settings - Fork 4
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
allow passing context to GetCertificate #9
Conversation
tscert.go
Outdated
) | ||
|
||
func defaultDialer(ctx context.Context, network, addr string) (net.Conn, error) { | ||
func DefaultDialer(ctx context.Context, network, addr string) (net.Conn, error) { |
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 isn't the best name imo. And would need docs.
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.
It sounds like a type or var. A func would sound like a verb.
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.
just Dial
? DialLocalAPI
?
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.
went with DialLocalAPI.
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.
Sgtm
Add a new GetCertificateWithContext to allow passing an existing context. Also export the default dialer method, so that callers that override TailscaledDialer can fall back to this if other methods fail. Signed-off-by: Will Norris <will@tailscale.com>
Add a new GetCertificateWithContext to allow passing an existing context. Also export the default dialer method, so that callers that override TailscaledDialer can fall back to this if other methods fail.
This is being added to support the caddy-tailscale plugin to work with caddy's auto_https functionality. See tailscale/caddy-tailscale#53
/cc @mholt