Skip to content

Commit 74eb920

Browse files
Backport of Fix: Vault provider failure when signing intermediate CA with isCA=true in CSR into release/1.22.x (#23203)
backport of commit c1ad4a8 Co-authored-by: anilvpatel <anilkumarvinodbhai.patel@hashicorp.com>
1 parent 0a553a2 commit 74eb920

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changelog/23202.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
connect: Fix intermediate CA signing failure with Vault provider when CSR included Basic Constraints isCA=true.
3+
```

agent/connect/ca/provider_vault.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ func (v *VaultProvider) GenerateLeafSigningCert() (string, error) {
604604
// Sign the CSR with the root backend.
605605
intermediate, err := v.writeNamespaced(v.config.RootPKINamespace, v.config.RootPKIPath+"root/sign-intermediate", map[string]interface{}{
606606
"csr": csr,
607-
"use_csr_values": true,
607+
"use_csr_values": false,
608+
"uri_sans": v.spiffeID.URI().String(),
608609
"format": "pem_bundle",
609610
"ttl": v.config.IntermediateCertTTL.String(),
610611
})
@@ -777,7 +778,8 @@ func (v *VaultProvider) SignIntermediate(csr *x509.CertificateRequest) (string,
777778
// Sign the CSR with the root backend.
778779
data, err := v.writeNamespaced(v.config.RootPKINamespace, v.config.RootPKIPath+"root/sign-intermediate", map[string]interface{}{
779780
"csr": pemBuf.String(),
780-
"use_csr_values": true,
781+
"use_csr_values": false,
782+
"uri_sans": v.spiffeID.URI().String(),
781783
"format": "pem_bundle",
782784
"max_path_length": 0,
783785
"ttl": v.config.IntermediateCertTTL.String(),

0 commit comments

Comments
 (0)