mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
Remove duplicated certificates from chains (#14348)
As reported by Steve Clark, building an intermediate mount in PKI (and calling /intermediate/set-signed) results in a duplicate intermediate CA certificate in the full chain output (ca_chain field of the /cert/ca_chain API endpoint response). Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
@@ -221,7 +221,7 @@ func (b *backend) pathFetchRead(ctx context.Context, req *logical.Request, data
|
||||
Type: "CERTIFICATE",
|
||||
Bytes: ca.Bytes,
|
||||
}
|
||||
chainStr = strings.Join([]string{certStr, strings.TrimSpace(string(pem.EncodeToMemory(&block)))}, "\n")
|
||||
chainStr = strings.Join([]string{chainStr, strings.TrimSpace(string(pem.EncodeToMemory(&block)))}, "\n")
|
||||
}
|
||||
fullChain = []byte(strings.TrimSpace(chainStr))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user