Skip to content

Commit

Permalink
Merge pull request #455 from Venafi/cloud-local-csr-fix
Browse files Browse the repository at this point in the history
fix(cloud-local-csr): Fixes issue with local generated CSR in cloud connector
  • Loading branch information
rvelaVenafi authored Apr 9, 2024
2 parents 8874536 + 8364b5f commit 039d25d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 7 additions & 3 deletions examples/tlspc-svc-account/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,25 @@ func main() {
log.Fatalf("error creating client: %s", err.Error())
}

_, err = connector.ReadZoneConfiguration()
zoneConfig, err := connector.ReadZoneConfiguration()
if err != nil {
log.Fatalf("error reading zone: %s", err.Error())

}

request := &certificate.Request{
Subject: pkix.Name{
CommonName: "svc-account.venafi.example.com",
},
CsrOrigin: certificate.ServiceGeneratedCSR,
CsrOrigin: certificate.LocalGeneratedCSR,
KeyType: certificate.KeyTypeRSA,
KeyLength: 2048,
}

err = connector.GenerateRequest(zoneConfig, request)
if err != nil {
log.Fatalf("error generating request: %s", err.Error())
}

certID, err := connector.RequestCertificate(request)
if err != nil {
log.Fatalf("error requesting certificate: %s", err.Error())
Expand Down
3 changes: 0 additions & 3 deletions pkg/venafi/cloud/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ func (c *Connector) ReadZoneConfiguration() (config *endpoint.ZoneConfiguration,
if err != nil {
return
}
} else {
// an error happened, return now
return
}
}
if template == nil {
Expand Down

0 comments on commit 039d25d

Please sign in to comment.