Manually downgrade HTTPS to HTTP
Problem
In certain cases upgrading the REST interface from HTTP to HTTPS fails, resulting in an inconsistent state where the connection is accepted via HTTPS only, but the HTTPS handshake fails. In this case the web management console becomes unavailable.
Example
When the REST interface is upgraded to HTTPS (for details see Configuration/Transport Layer Security) using an expired certificate, then the configuration will succeed. Later, when the actual connection happens from a browser client, the browser will refuse to connect cause the certificate is expired.
Solution
Prerequisites
The resolution requires the following:
- PsExec tool from Microsoft Sysinternals being installed,
- Administrator privileges to edit the config file and reload REST backend.
PsTools containing the PsExec tool can be downloaded from https://docs.microsoft.com/en-us/sysinternals/downloads/psexec.
Resolution
To manually downgrade the REST interface from HTTPS to HTTP perform the following steps:
While performing this steps, it is important that the MetaDefender Email Gateway Security service must be running.
DO NOT stop the MetaDefender Email Gateway Security service before performing these steps!
Revert TLS related configuration
- As Administrator, open C:\Windows\Temp\mdemailsecurity\nginx.conf for editing
- Search for the following directives inside the server section:
- listen
- ssl_certificate
- ssl_protocols
- Modify both listen directives removing the ssl clause from them; and entirely delete the ssl_certificate and ssl_protocols directives
- Save C:\Windows\Temp\mdemailsecurity\nginx.conf.
Reload REST backend with modified configuration
- As Administrator launch the following command in a command shell:
1. Example:
- Check the command output for potential errors
- On success nginx.exe must exit with code 0. For example:
2. The following message does not indicate an error:
Open the web management console via HTTP
- Open Email Gateway Security’s web management console pointing your browser to the location where the product’s REST interface is listening
- Remember to provide http as schema instead of https
- Example:
Disable HTTPS in web management console
- Navigate to Settings > Security and make Enable HTTPS connection disabled

After performing all these steps, Email Gateway Security will be available via HTTP even after a service restart.