Vault - How do I replace a self-signed certificate with a proper CA certificate?
Objective
The following can be used to replace a self-signed certificate with a proper CA certificate on the vault
Environment
N/A
Procedure
Create the Vault.csr (Certificate Request):
*Note* The following commands must be run in an elevated command prompt (i.e. as Administrator), or you will receive errors.
On the Vault run:
CACert.exe request /ReqOutFile Vault.csr /CommonName "<insert-hostname>.localdomain.local" /SubjAlt "DNS:<insert-hostname>.localdomain.local, IP:<insert-IP-address>"
This will replace the certificate in your ServerPrivateKey= location specified in the dbparm.ini. It is a good idea to backup and also temporarily change the location just to generate the CSR.
Don't forget to change back the location after you have generated the request.
To create the certificate, copy the Vault.csr to the CA (Certificate Authority).
On the CA server run:
certreq -submit -attrib "CertificateTemplate:WebServer" Vault.csr Vault.cer
Download the root certificate and the Vault.cer to the Vault server.
Create a location where the root certificate needs will be installed (Example C:\Root\)
Add the location to the TrustedCAPath in the dbparm.ini (TrustedCAPath=C:\Root\root.cer)
Install the root certificate:
c:\Program Files (x86)\PrivateArk\Server>CACert.exe setca /Add root.cer
Install the Vault.cert:
CACert.exe install /CertFileName Vault.cer
Restart the Vault Service
After applying the new certificate, you must restart the PrivateArk Server service to apply the change.
Troubleshooting:
If you receive the following error, make sure you're running command prompt with elevated privileges (i.e. as Administrator).
CACRTCMD005E Failed while writing certificate to C:\ CA Keys\Server.pem (Code: -29)