An Administrative Domain (ADOM) upgrade from version 7.4 to 7.6 fails due to a remote certificate missing its PEM wrapper, resulting in a certificate invalid error.
SymptomsWhen attempting to upgrade an ADOM from version 7.4 to 7.6 in FortiManager, the process fails with the following error message:
Fail (errno=-2):This remote certificate is invalid
Root cause
The upgrade fails because one or more remote certificates in the ADOM database are stored without the required PEM wrapper (the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines). While the certificate may be valid for current operations, the ADOM upgrade process to version 7.6 rejects certificates that do not follow this standard format.
ResolutionRestore the PEM wrapper to the affected certificate using a script.
Step 1: Identify the problematic certificateSelect Policy & Objects -> Advanced -> Remote Certificate in the root ADOM. Review the entries for certificates that appear incomplete, expired, or use default names.
Use the Where Used feature to check if the suspicious certificate is referenced in SAML or PKI user configurations.
Run the ADOM Upgrade Readiness check for the root ADOM and export the report to identify the specific affected object.
Step 2: Fix the certificate wrapperTake a FortiManager configuration backup.
Select Device Manager -> Scripts in the root ADOM and create and import the script with wrapper details that restores the PEM wrapper.
config vpn certificate remote
edit "certificate"
set remote "-----BEGIN CERTIFICATE-----
Do not change the certificate content
-----END CERTIFICATE-----"
set range global
next
end
Run the script against any policy package in the root ADOM. Because certificates are shared ADOM objects, the change applies to the entire ADOM.
See How to add a script.
Step 3: Complete the ADOM upgradeSelect System Settings -> ADOMs. Select the ADOM and upgrade it to version 7.6. Before installing changes to the FortiGate devices, run an install preview on devices using the modified certificate (such as those using SAML) to confirm there are no unexpected configuration changes.
Troubleshooting the upgrade failureIf the ADOM upgrade continues to fail, capture debug logs by running the following commands in a session with logging enabled:
diagnose debug reset
diagnose debug enable
diagnose debug timestamp enable
diagnose debug service cdb 255
diagnose debug service dvmdb 255
diagnose debug service dvmcmd 255
diagnose debug service sys 255
diagnose debug service main 255
Retry the upgrade until it fails, then stop the debug process with:
diagnose debug reset
diagnose debug disable
Related Articles: Technical Tip: How to upgrade an ADOM on FortiManager |