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

x/crypto/acme/autocert: expose cacheDir function #21151

Closed
bradrydzewski opened this issue Jul 24, 2017 · 3 comments
Closed

x/crypto/acme/autocert: expose cacheDir function #21151

bradrydzewski opened this issue Jul 24, 2017 · 3 comments

Comments

@bradrydzewski
Copy link

I would like the ability to use the default cache directory logic in situations where I have to create a custom cert manager, however, it is currently a private function. Would a change to expose this logic be accepted?

Reference code: https://github.com/golang/crypto/blob/6914964337150723782436d56b3f21610a74ce7b/acme/autocert/listener.go#L142

@gopherbot gopherbot added this to the Unreleased milestone Jul 24, 2017
@bradfitz
Copy link
Contributor

I'd rather not.

This is an ACME cert package, not a filesystem path package.

Stuff like https://godoc.org/go4.org/xdgdir exists to return conventional paths.

@bradrydzewski
Copy link
Author

bradrydzewski commented Jul 24, 2017

Thanks for the quick reply!

This is an ACME cert package, not a filesystem path package.

To clarify I am less interested in the path string value, and more interested in obtaining a DirCache with default path logic when I am unable to use NewListener.

Something like this:

manager := autocert.Manager{
	Prompt:     autocert.AcceptTOS,
	HostPolicy: autocert.HostWhitelist(address.Host),
+	Cache:      autocert.DirCacheFromEnv(),
}

The cacheDir function includes some additional logic for windows and falls back to the home directory. I was looking for a consistent way to cache certificates regardless of how autocert.Manager is created, but certainly understand if there is no interest in exposing these internals.

Stuff like https://godoc.org/go4.org/xdgdir exists to return conventional paths.

Thanks for the link, I will investigate further to see if I can use in my project.

@ALTree
Copy link
Member

ALTree commented Sep 26, 2019

It appears we're not going to do this, so I'm closing this issue.

@ALTree ALTree closed this as completed Sep 26, 2019
@golang golang locked and limited conversation to collaborators Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants