Fix PKI tests by generating on-demand

This commit is contained in:
Jeff Mitchell
2018-02-20 00:03:45 -05:00
parent 5b14b464ff
commit 2d22d8a99a
6 changed files with 107 additions and 133 deletions

View File

@@ -168,13 +168,15 @@ func (b *backend) pathFetchRead(ctx context.Context, req *logical.Request, data
}
caChain := caInfo.GetCAChain()
var certStr string
for _, ca := range caChain {
block := pem.Block{
Type: "CERTIFICATE",
Bytes: ca.Bytes,
}
certificate = append(certificate, pem.EncodeToMemory(&block)...)
certStr = certStr + string(pem.EncodeToMemory(&block))
}
certificate = []byte(certStr)
goto reply
}