How is the target directory over 100 gigs?
Some checks failed
🏗️✨ Test Build Workflow / 🖥️ 🔨 Build (push) Has been cancelled

This commit is contained in:
2025-05-14 22:45:29 -04:00
parent 5259fb9aa4
commit f75955e154
5 changed files with 42 additions and 48 deletions

View File

@@ -628,25 +628,18 @@ func parseDERFromPEM(pemDataId string, blockType string) (*pem.Block, error) {
}
func ReadCertificateBundleData(certificateBundleId string) ([]*x509.Certificate, error) {
bts, err := os.ReadFile(certificateBundleId)
if err != nil {
return nil, err
}
var derBytes []byte
var block *pem.Block
for len(bts) > 0 {
block, bts = pem.Decode(bts)
if block == nil {
break
}
if block.Type != "CERTIFICATE" {
return nil, errors.New("invalid certificate chain")
}
blockBytes := block.Bytes
derBytes = append(derBytes, blockBytes...)
block, _ = pem.Decode([]byte(certificateBundleId))
if block.Type != "CERTIFICATE" {
return nil, errors.New("invalid certificate chain")
}
blockBytes := block.Bytes
derBytes = append(derBytes, blockBytes...)
return x509.ParseCertificates(derBytes)
}