This article provides steps to configure Certificate-Based Authentication using CA-signed/Custom certificates.
Unable to use PKCS #12 certificates on versions 9.0.1, 9.0.2, 9.0.3, and 9.0.4.
Unable to apply the CA chain certificate.
Unable to apply a custom certificate on the appliance.
Unable to convert .cer / .crt / .pem certificates into PKCS #12 format for use with the appliance.
Unable to successfully create or apply CA-signed certificates with a 4096-bit key size.
When attempting to replace the VMware Live Site Recovery appliance certificate with a custom PKCS #12 file, the following error is observed:
“The certificate is not in the correct format or has a different password.”
Unable to generate a CSR using only an FQDN in IP-restricted environments.
VMware Live Site Recovery 9.0.1.x
VMware Live Site Recovery 9.0.2.x
VMware Live Site Recovery 9.0.3.x
VMware Live Site Recovery 9.0.4.x
In many cases, the certificate is successfully applied on the appliance; however, the reconfigure task fails afterward. This typically occurs because the private key is incorrect or inaccessible when applying a custom certificate.
When a CSR is generated from the appliance GUI, the private key is automatically generated and stored in the appliance’s default location, and the same key is used during certificate application.
When a CSR is generated using the OpenSSL command, the private key is generated externally and is not stored in the appliance’s default location. As a result, the appliance cannot access the private key during certificate application, causing the task to fail.
PKCS #12 format is not supported in VLSR versions 9.0.3 and 9.0.4.
Applying a PKCS #12 certificate fails when the CSR is generated using OpenSSL, because the associated private key is not present in the appliance’s default location. This limitation applies specifically to appliance-based certificate replacement on versions 9.0.1 and 9.0.2.
When attempting to replace the VMware Live Site Recovery appliance certificate with a custom PKCS #12 file on versions 9.0.1 and 9.0.2, using a CSR generated from the UI, the following error may appear:
“The certificate is not in the correct format or has a different password.”
If the password is verified as correct, this error is typically caused by the PKCS #12 file being created with the legacy encryption algorithm RC2-40-CBC, which is not supported.
While 4096-bit key size certificates are supported by the appliance, applying such certificates may still fail if the private key is not present in the appliance’s default location, which is required for successful certificate replacement.
By default, the appliance uses PEM-format certificates. Ensure that all certificates are converted to PEM format before applying them to the appliance.
If your environment does not require PKCS #12 certificates, there is no need to use this format. PEM format is fully supported and recommended, unless PKCS #12 is explicitly mandated by your certificate authority or internal security policy.
When using a certificate chain with non-PKCS #12 formats:
Combine the root CA and intermediate (sub-CA) certificates into a single file.
Keep the appliance (leaf) certificate in a separate file.
When applying certificates:
Only the appliance (leaf) certificate is mandatory.
The CA chain is optional during the initial certificate application.
Root and intermediate CA certificates can be added after the certificate is applied, if required.
If the CSR is generated via the command line (OpenSSL), ensure that the generated private key is moved to the appliance’s default private key location. The appliance must be able to access the private key from this location for the certificate application to succeed.
Wherever possible, use the VLSR appliance itself to generate the CSR via the command line and to perform OpenSSL-related operations to avoid compatibility or file placement issues.
Note:
For appliance versions 9.0.1 and 9.0.2, the default private key location is: /opt/vmware/dr/conf/
For appliance versions 9.0.3 and 9.0.4, the default private key location is: /opt/vmware/etc/va-configurator/
The expected private key file name is csrkey.pem.
SSH to the appliance.
Switch to the root user.
Create the required directory and copy the OpenSSL configuration file:
Generate a CSR using the VAMI (GUI) to create the default private key file csrkey.pem in the appliance’s default location.
This key will be replaced later with the private key generated using OpenSSL in the following steps.
Run the following command to generate a new private key and CSR:
Replace the following values according to your environment:
vlsr.csr → Required CSR file name
vlsr.key → Required private key file name
C, ST, L, O, OU, CN → Country, State, Locality, Organization, Organizational Unit, and Common Name
DNS:FQDN → Hostname / Fully Qualified Domain Name
IP:IP-address → Appliance IP address
Notes:
The country code (C) must be a two-letter value (for example, US).
If an alias is not required, remove DNS:alias.
If an IP address is not required, remove IP:IP-address.
To generate a 4096-bit key, replace rsa:2048 with rsa:4096.
openssl req -new -nodes -newkey rsa:2048 -keyout vlsr.key -out vlsr.csr -subj "/C=US/ST=CA/L=PaloAlto/O=VMware/OU=SRM/CN=vlsr.domain_name.top-level-domain" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf; printf "\n[SAN]\nsubjectAltName=DNS:vlsr.domain_name.top-level-domain,DNS:vlsr,IP:XXX.XXX.X.XX")
openssl rsa -in vlsr.key -out csrkey.pem -outform PEMcp csrkey.pem /opt/vmware/dr/conf/csrkey.pemcp csrkey.pem /opt/vmware/etc/va-configurator/csrkey.pemUse the generated .csr file to request a signed certificate from your Certificate Authority (CA).
If a chained certificate is issued:
Export any intermediate CA certificates in separate files as well.
Convert a Certificate from CRT, DER, or CER Format to PEM Format
Use the following OpenSSL command to convert the certificate to PEM format: openssl x509 -in cert.crt -out cert.pem -outform PEM
Note: Replace cert.crt with cert.cer or cert.der, as applicable to your certificate format.
Replace the certificate using the VAMI GUI.
Refresh the browser and log in again.
Verify:
The certificate is shown in the browser.
The certificate displayed under the Certificate tab in VAMI.
Both must match.
Add the root and intermediate CA certificates to the appliance if required.
Reconfigure the appliance to complete the certificate replacement process.
.cer / .crt Certificates to PKCS #12 Format without legacy algorithmsImportant:
Conversion to PKCS #12 requires the private key in
.keyformat.This procedure is supported only for versions 9.0.1 and 9.0.2.
A valid certificate file (.cer or .crt)
The corresponding private key
SSH access to the appliance with root privileges
If the CSR was generated via the GUI, the private key is created in PEM format (csrkey.pem).
If the CSR was generated via OpenSSL, the private key is typically already available in .key format.
If the key is in PEM format, it must be converted to .key format before generating the PKCS #12 file.
.key Format (If Required)SSH to the appliance and switch to the root user.
Navigate to the default private key location:
cd /opt/vmware/dr/conf
Convert the PEM key to .key format: : openssl rsa -in csrkey.pem -out /home/admin/csrkey.key
The converted private key will be created at: /home/admin/csrkey.key
Run the following command to generate the PKCS #12 file using modern encryption algorithms (non-legacy): openssl pkcs12 -export -inkey csrkey.key -in cert.cer -out cert.p12 -keypbe aes-256-cbc -certpbe aes-256-cbc
Notes:
Replace cert.cer with cert.crt if applicable.
You will be prompted to set a password for the .p12 file.
The cert.p12 file will be generated upon successful completion.
Use SCP to download the generated cert.p12 file to your local system.
Log in to the VAMI interface.
Navigate to: VAMI > Certificate > Change
Select the PKCS #12 option.
Upload the cert.p12 file and provide the password. Click on change.
After Chaning the certificate, you may see an error message.
This behavior is expected when applying PKCS #12 certificates.
Refresh the browser page.
Log in to the VAMI interface again.
Verify the certificate:
From the browser certificate details
From VAMI > Certificate
Ensure that the Issuer and Fingerprint match the uploaded certificate. If the details match, the certificate has been successfully replaced.
The most common SSL certificates are defined by X.509. The digital certificates have different formats. Here’s a brief overview of several common formats of SSL certificates:
PEM: private key or certificate
CER: only certificate
DER: only certificate
CRT: only certificate
PFX: private key and certificate
P12/P7B: private key and certificate
JKS: private key and certificate
KEY: public key or private key
The PEM format is the most common format that Certificate Authorities issue certificates in. PEM certificates usually have extensions such as .pem, .crt, .cer, and .key. They are Base64 encoded ASCII files and contain "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" statements. Server certificates, intermediate certificates, and private keys can all be put into the PEM format.
Apache and other similar servers use PEM format certificates. Several PEM certificates, and even the private key, can be included in one file, one below the other, but most platforms, such as Apache, expect the certificates and private key to be in separate files.
The DER format is simply a binary form of a certificate instead of the ASCII PEM format. It sometimes has a file extension of .der but it often has a file extension of .cer so the only way to tell the difference between a DER .cer file and a PEM .cer file is to open it in a text editor and look for the BEGIN/END statements. All types of certificates and private keys can be encoded in DER format. DER is typically used with Java platforms. The SSL Converter can only convert certificates to DER format. If you need to convert a private key to DER, please use the OpenSSL commands on this page.
The PKCS#7 or P7B format is usually stored in Base64 ASCII format and has a file extension of .p7b or .p7c. P7B certificates contain "-----BEGIN PKCS7-----" and "-----END PKCS7-----" statements. A P7B file only contains certificates and chain certificates, not the private key. Several platforms support P7B files including Microsoft Windows and Java Tomcat.
The PKCS#12 or PFX format is a binary format for storing the server certificate, any intermediate certificates, and the private key in one encryptable file. PFX files usually have extensions such as .pfx and .p12. PFX files are typically used on Windows machines to import and export certificates and private keys.
When converting a PFX file to PEM format, OpenSSL will put all the certificates and the private key into a single file. You will need to open the file in a text editor and copy each certificate and private key (including the BEGIN/END statements) to its own individual text file and save them as certificate.cer, CACert.cer, and privateKey.key respectively.
A very common need before deploying the certificate to the server is to compare the mutual match of the private key and the issued certificate. These are always a few keys that must belong together. Otherwise, the certificate would not be installed, or worse, a key error could cause the site to malfunction. The interconnection also applies between the private key and the certificate request (CSR).
A sequence of two OpenSSL commands separated by a "|" character is used to compare keys resulting in a character string that must be the same for both keys. In this case, the tested keys belong together.
The following commands should be entered one after the other to generate separate outputs. The output is an md5 hash (fingerprint) of the key, it can be replaced by the sha256 algorithm, which, however, gives a longer string of characters. You can name the file extensions as you need and you are used to, for example .csr, .crt, .txt.
Comparison of the private key and the issued certificate:
Comparison of private key and certificate request:
Each command results in a character string. If the output of each command matches, the keys belong together. If the outputs do not match, the keys do not match and the certificate cannot be installed. The only solution is to generate new keys.
Use the x509 command to check the issued certificate and its information. This can verify that the information in the certificate is correct and matches your private key.