x509roots/fallback/bundle: add bundle package to export root certs

Fixes golang/go#69898

Change-Id: Idbb1bbe48016a622414c84a56fe26f48bfe712c8
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/687155
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
This commit is contained in:
Michael Stapelberg
2025-09-11 08:14:50 -07:00
committed by Gopher Robot
parent 8c9ba31836
commit 96dc232fbd
7 changed files with 106 additions and 65 deletions
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package bundle
import (
"crypto/x509"
"testing"
)
func TestRootsCanBeParsed(t *testing.T) {
for root := range Roots() {
if _, err := x509.ParseCertificate(root.Certificate); err != nil {
t.Fatalf("Could not parse root certificate: %v", err)
}
}
}