| Description | This article describes the scenario where the STARTTLS connection cannot be established to the FortiMail Server when SSL/SSH deep-inspection is enabled on the firewall policy. |
| Scope | FortiGate, FortiMail. |
| Solution |
In this scenario, a FortiGate is placed before the FortiMail. Some mail servers cannot establish a STARTTLS connection to this infrastructure.
SSL/SSH is enabled on the firewall policy, and this can also be configured with web server protection active, as seen below:
The errors seen on FortiMail are as follows: 'STARTTLS=server, error: accept failed=-1, reason=unknown, SSL_error=5, errno=0, retry=-1, relay=<mailserver> <IP address>'
And on FortiGate: 'Client connection failure due to incorrect SSL handshake message.(type:1)'
If the SSL/SSH profile is disabled on the firewall policy, the issue is no longer present. Mostly, this error occurs for 2 reasons:
The following can be done to mitigate the issue:
config firewall ssl-ssh-profile
The options are as follows:
config system global set ssl-versions ? tls1_0 TLS 1.0
While the configuration and the certificate used on the FortiGate and FortiMail are the same, if the issue is only happening for some recipients, it might be that these senders do not match the settings configured on FortiGate, or are using lower TLS versions, so these changes might be helpful in this case. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2026 Fortinet, Inc. All Rights Reserved.