vcert playbook failing with unexpected Private Key type: ENCRYPTED PRIVATE KEY when using csr: service

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vcert playbook failing with unexpected Private Key type: ENCRYPTED PRIVATE KEY when using csr: service

L0 Member

Hello,

I am attempting to automate certificate renewals using vcert and vcert playbooks with TPP but am encountering an error and was looking for guidance or troubleshooting steps.

I am using vcert version v5.10.0.

 

In my testing, I had been using `csr: local`, but it appears at least some of my servers will require me to use `csr: service` as I got this error when running the playbook:

400 Certificate request mismatch. Certificate "<PATH REMOVED>" is originated from a Service Generated CSR, but the request contains a PKSC#10.

 

However, when I set `csr: service` in my playbook, I instead get this output:

2025-07-07T09:35:52.178-0500 INFO vcert/playbook.go:103 running playbook file {"file": "/path/to/my/playbook.yml"} 2025-07-07T09:35:52.179-0500 INFO parser/reader.go:59 playbook successfully parsed 2025-07-07T09:35:52.179-0500 INFO vcert/playbook.go:133 using Venafi Platform {"platform": "TPP"} 2025-07-07T09:35:52.353-0500 INFO vcert/playbook.go:146 running playbook task {"task": "myCertificate"} 2025-07-07T09:35:52.353-0500 INFO service/service.go:114 Flag [force-renew] is set. All certificates will be requested/renewed regardless of status 2025-07-07T09:35:52.353-0500 INFO service/service.go:60 certificate needs action {"certificate": "certificate.name.removed"} 2025-07-07T09:35:52.353-0500 INFO service/service.go:65 csr option is 'service'. Generating random password for certificate request 2025-07-07T09:35:55.834-0500 INFO service/service.go:74 successfully enrolled certificate {"certificate": "certificate.name.removed"} 2025-07-07T09:35:55.834-0500 ERROR service/service.go:88 error preparing certificate for installation {"error": "could not prepare certificate and key: unexpected Private Key type: ENCRYPTED PRIVATE KEY"} 2025-07-07T09:35:55.834-0500 ERROR vcert/playbook.go:151 error running task {"task": "myCertificate", "error": "error preparing certificate for installation: could not prepare certificate and key: unexpected Private Key type: ENCRYPTED PRIVATE KEY"}

It appears that the new certificate is being successfully enrolled, but vcert is not automatically decrypting the certificate correctly.

 

I came across this GitHub issue and wonder if it's related: https://github.com/Venafi/vcert/issues/538

In the sample where `luispresuelVenafi` says they were unable to reproduce the issue, their output shows they call vcert with `--csr local` and not `--csr service` as described by the reporter.

CC: @Tim Griffith​ 

2 REPLIES 2

L4 Transporter

Hi @Alex Wolfe​ , someone from the community might be able to help with this, but I wanted to recommend you create a support case. This type of question is usually best handled by the CyberArk Support team. You can open a case from the Services Hub: https://community.cyberark.com/s/services-hub

L0 Member

Thank you, I have opened case 04060603

  • 176 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!