LoadPEMCertPool loads a pool of PEM certificates from file.
(certsFile string)
| 344 | |
| 345 | // LoadPEMCertPool loads a pool of PEM certificates from file. |
| 346 | func LoadPEMCertPool(certsFile string) (*x509.CertPool, error) { |
| 347 | if certsFile == "" { |
| 348 | return nil, nil |
| 349 | } |
| 350 | pemCerts, err := os.ReadFile(certsFile) |
| 351 | if err != nil { |
| 352 | return nil, err |
| 353 | } |
| 354 | |
| 355 | return PEMToCertPool(pemCerts) |
| 356 | } |
| 357 | |
| 358 | // PEMToCertPool concerts PEM certificates to a CertPool. |
| 359 | func PEMToCertPool(pemCerts []byte) (*x509.CertPool, error) { |
searching dependent graphs…