Technical Tip: FortiManager SSL/SSH Inspection Profile Installation Failure: 'unset ports' error (return code -651)
| Description | This article describes a known issue in FortiManager where disabling the HTTPS protocol under Protocol Port Mapping in a custom SSL/SSH Inspection profile causes a policy installation failure on the managed FortiGate. The failure is triggered by an invalid CLI command generated by FortiManager ('unset ports'), which FortiGate does not accept, resulting in Return Code –651. |
| Scope | FortiManager, FortiGate. |
| Solution | Create a custom SSL/SSH Inspection profile based on the built-in 'no-inspection' profile or clone the built-in 'no-inspection' profile and then modify the HTTPS protocol by enabling it under Protocol Port Mapping.
FortiManager will push the following configuration to the FortiGate:
When subsequently disabling the HTTPS protocol for that profile in the FortiManager GUI, FortiManager generates and tries to push the following configuration preview during the next policy installation:
Running the 'Installation Wizard' will generate the following error:
Root cause: The root cause is the 'unset ports' command generated by FortiManager.
FortiGate’s CLI requires that at least one port be defined or that 'ssl inspect-all' is enabled before the HTTPS status can be set to 'disable'.
Removing the port assignment while the HTTPS sub-object is still active violates this constraint and causes the installation to fail with 'Return Code –651'.
Workaround: Option 1: Clone the built-in 'no-inspection' profile. Clone the existing built-in 'no-inspection' profile from FortiManager and assign the clone to the affected Firewall Policies in place of the problematic profile. This avoids the issue entirely and has been confirmed to work.
Option 2: Run a CLI script remotely via FortiManager. Run a CLI script from FortiManager targeting the affected FortiGate. The script directly sets the HTTPS status to 'disable' within the profile, bypassing the 'unset ports' command entirely:
After running the script on the FortiGate, launch the 'Installation Wizard' from FortiManager. It will detect that no configuration delta remains, show 'Nothing to install', and mark the FortiGate as synchronized.
Note: This is a bug, and a permanent fix is planned for the next release of FortiOS v7.4, v7.6, and v8.0. Until the fix is released, use one of the workarounds above. |
