Skip to content

Commit

Permalink
re-position Request.Format check after CSR handling, based on PR comm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
eyalle committed Mar 27, 2023
1 parent 1d7d42b commit c6f37f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/venafi/tpp/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -1202,11 +1202,6 @@ func (c *Connector) RetrieveCertificate(req *certificate.Request) (certificates
includeChain := req.ChainOption != certificate.ChainOptionIgnore
rootFirstOrder := includeChain && req.ChainOption == certificate.ChainOptionRootFirst

// if Request doesn't contain a Format, use defaults
if req.KeyType == certificate.KeyTypeRSA {
req.Format = certificate.CertFormatBase64PKCS8
}

if req.PickupID == "" && req.Thumbprint != "" {
// search cert by Thumbprint and fill pickupID
searchResult, err := c.searchCertificatesByFingerprint(req.Thumbprint)
Expand Down Expand Up @@ -1234,6 +1229,11 @@ func (c *Connector) RetrieveCertificate(req *certificate.Request) (certificates
certReq.Password = req.KeyPassword
}

// if Request doesn't contain a Format, use defaults
if req.KeyType == certificate.KeyTypeRSA {
req.Format = certificate.CertFormatBase64PKCS8
}

startTime := time.Now()
for {
var retrieveResponse *certificateRetrieveResponse
Expand Down

0 comments on commit c6f37f7

Please sign in to comment.