makeRootProvider creates a new instance of the fakeProvider returning the root key material specified in the provider file paths.
(t *testing.T, caPath string)
| 209 | // makeRootProvider creates a new instance of the fakeProvider returning the |
| 210 | // root key material specified in the provider file paths. |
| 211 | func makeRootProvider(t *testing.T, caPath string) *fakeProvider { |
| 212 | pemData, err := os.ReadFile(testdata.Path(caPath)) |
| 213 | if err != nil { |
| 214 | t.Fatal(err) |
| 215 | } |
| 216 | roots := x509.NewCertPool() |
| 217 | roots.AppendCertsFromPEM(pemData) |
| 218 | return &fakeProvider{km: &certprovider.KeyMaterial{Roots: roots}} |
| 219 | } |
| 220 | |
| 221 | // newTestContextWithHandshakeInfo returns a copy of parent with HandshakeInfo |
| 222 | // context value added to it. |
no test coverage detected