When attempting to upload a .pfx certificate file to the Avi Load Balancer Controller (version 31.1.1 and above), the upload may fail with error - Missing private key data.
This error occurs even if the private key is present in the .pfx file.
The exact same .pfx file uploads without any issues on older versions of the Avi Controller, such as version 22.1.7.
Example screenshot of the error:
Avi version 31.1.x
Avi version 31.2.x
.pfx file was packaged using an outdated encryption cipher, such as RC2-40-CBC, the Avi Controller will refuse to decrypt the legacy wrapper and reject the upload..pfx file on the Avi controller bash:#openssl pkcs12 -info -in your_certificate.pfx -noout
routines:inner_evp_generic_fetch:unsupported:../crypto/evp/evp_fetch.c:355:Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()
To resolve this issue, you must bypass the outdated encryption wrapper by extracting the certificate contents manually using a local machine, and then import the plain-text components directly into the Avi UI.
Step 1: Extract and Decrypt the Certificate Using a local machine with OpenSSL installed (or the Avi controller Linux bash), extract the contents of the .pfx file into a plain-text .pem file. You must include the -legacy flag to instruct OpenSSL to read the older RC2 cipher.
openssl pkcs12 -in your_certificate.pfx -legacy -nodes -out temp_cert.pem
Step 2: Isolate the Certificate Components Open the newly generated temp_cert.pem file in a standard text editor. Inside, you will see multiple cryptographic blocks. Typically, this consists of:
One Private Key block (-----BEGIN PRIVATE KEY-----)
Two or more Certificate blocks (-----BEGIN CERTIFICATE-----), representing your Server Certificate and the Intermediate CA(s).
Step 3: Import the Certificate via the Avi UI Log back into the Avi Controller UI to create the certificate manually using the extracted components:
Paste the entire -----BEGIN PRIVATE KEY----- block into the Key field.
Paste the first -----BEGIN CERTIFICATE----- block (which represents your Server Certificate) into the Certificate field.
Save the configuration.
Future Recommendation: For future certificate renewals, we highly recommend ensuring that your CA or certificate tool generates .pfx files using modern encryption algorithms (such as AES256-SHA256). Modernizing your certificate encryption will allow you to securely upload .pfx files directly via the Avi UI in 31.2.x without needing this manual OpenSSL workaround.