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

Add built-in root certificate fallbacks #3440

Merged
merged 2 commits into from
Dec 7, 2023
Merged

Commits on Dec 6, 2023

  1. Add built-in root certificate fallbacks

    Blank-importing golang.org/x/crypto/x509roots/fallback bundles a set of
    root fallback certificates from Mozilla into the resulting binary. This
    allows the program to run in environments where the system root
    certificates are not available, for example inside a minimal container.
    These are _fallbacks_, meaning that if the system _does have_ a set of
    root certificates, those will be given priority. The binary size will
    increase a little (~ 220 kB).
    
    It should be added added to main.go instead of somewhere else because the
    recommendation is for the package to be imported from binaries, not from
    libraries. Calling x509.SetFallbackRoots (what the imported package does
    in its init function) more than once will cause the program to panic. In
    principle, the Go import system will prevent the package from being
    imported twice, so that shouldn't be a problem. That said, xk6 has
    opinions, and it doesn't want to have an import in main.go, so it's
    added to the only package imported from main, "cmd".
    
    Signed-off-by: Marcelo E. Magallon <[email protected]>
    Co-authored-by: Oleg Bespalov <[email protected]>
    mem and olegbespalov committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    40fd911 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c89b34d View commit details
    Browse the repository at this point in the history