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

Use x509.SetFallbackRoots and switch away from gocertifi #628

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

edigaryev
Copy link
Contributor

@edigaryev edigaryev commented Jun 7, 2023

  1. Use x509.SetFallbackRoots to prefer the OS-provided CA certificate store over some static set of certificates we've got through a package dependency that had chosen some arbitrary CA set to use and needs to be updated periodically both on our side and on the side of the package.

    This change simplifies the code greatly by only requiring a single x509.SetFallbackRoots() call in each main package, and in our case we only need one such call.

    The only downside of this approach is that if the operating-system's CA certificate store is not empty and some of the certificates are outdated, the connection might fail.

  2. Switch away from github.com/certifi/gocertifi because it hasn't been maintained for more than 2 years.

    Unfortunately, the official golang.org/x/crypto/x509roots/fallback is not ready yet, but the package of the person who initially created the issue (crypto/x509: add SetFallbackRoots and golang.org/x/crypto/x509roots/fallback package golang/go#43958) seems to be well maintained and documented.

@edigaryev edigaryev requested a review from fkorotkov June 7, 2023 22:06
@edigaryev edigaryev force-pushed the set-fallback-roots branch from ac27db6 to 3f03df1 Compare June 7, 2023 22:46
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