TLS 探测配置
TLS 探测配置
TLS 探测介绍
当 FortiGate 在检查基于 TLS 的连接(如开启 WebFilter 并检测 HTTPS 连接)时,客户端经过 FortiGate 的业务 VDOM 访问某个 HTTPS 网站,FortiGate 会提取客户端 PC 发送的 TLS Client Hello 中的 SNI,从 SNI 中提取网站的域名,然后先于客户端去探测网站证书的合法性,这是为了保证后续 TLS 协商以及业务报文的安全性。TLS 探测报文的源地址只会使用 FortiGate 自身的 IP 地址。
在多出口、多 VDOM、透明模式、SD-WAN、接口配置第二 IP 等场景下,TLS 探测可能会因路由或线路问题导致超时失败。
拓扑信息
FortiGate 如果开启了网页过滤(Web Filter)功能,需要注意如下拓扑环境下的配置。
- FortiGate 划分了多个 VDOM:
- 管理 VDOM 接口(mgmt)可以访问 Internet 与内网其他设备,用于登录、FortiGuard 分类查询、Syslog、SNMP 等管理业务。
- 业务 VDOM 的所有接口只做业务转发,接口 IP 无法访问 Internet。
- 通过业务 VDOM 接口转发的流量可以正常访问 Internet。
- FortiGate 未开启 VDOM:
- 默认路由中包含多个出接口。
- 其中一些出接口的 IP 无法访问 Internet。
- 接口配置了第二地址,只有第二地址可以访问 Internet。
问题现象
以 FortiGate 多 VDOM 的场景为例。默认配置下,从 FortiGate 发送的 TLS 探测报文,只能以防火墙业务 VDOM 自己的接口 IP 来发出。
如果业务 VDOM 的接口 IP 本身无法访问 Internet 的,FortiGate 去探测网站 HTTPS 时,TCP 是无法建立的,超时 3s 后,会放弃 TLS 探测,继续真实客户端的 TLS 报文的转发。如下所示在 FortiGate 业务 VDOM 的外网口抓包。

相关 IPS Debug 日志显示 TLS 探测失败。
diagnose ips filter set "(host x.x.x.x or host x.x.x.x) and port 443" diagnose ips debug enable all diagnose debug console timestamp enable diagnose debug enable 2024-12-27 15:32:49 [10600@-1]ssl_resume_sess: sess 4311: ssl resume 2024-12-27 15:32:49 [10600@-1]ips_urlf_del_query: id:2229, queue:0 2024-12-27 15:32:49 [10600@-1]eng_debug_log: Probe info: 2024-12-27 15:32:49 [10600@-1]eng_debug_log: Server: 8.134.8.151:443 2024-12-27 15:32:49 [10600@-1]eng_debug_log: Server name: stackio.cn 2024-12-27 15:32:49 [10600@-1]eng_debug_log: STARTTLS: no 2024-12-27 15:32:49 [10600@-1]eng_debug_log: Probe failed: unable to connect <----TLS探测失败 2024-12-27 15:32:49 [10600@-1]eng_debug_log: parallel probes: 1 2024-12-27 15:32:49 [10600@-1]eng_debug_log: Memory usage: 276 KiB, errors: 2046 2024-12-27 15:32:49 [10601@-1]probe_finish: probe is finished. id: 1194, sess: 4218 2024-12-27 15:32:49 [10601@-1]ssl_resume_sess: sess 4218: ssl resume 2024-12-27 15:32:49 [10601@-1]ips_eng_log_ssl: ssl log host stackio.cn, CN , type 12对应的 SSL 安全事件日志(日志子类型为
certificate-probe-failed)。date=2025-10-16 time=14:20:41 eventtime=1760595641888725921 tz="+0800" logid="1700062305" type="utm" subtype="ssl" eventtype="ssl-anomaly" level="warning" vd="root" action="allow" policyid=1 poluuid="04d852a8-7f02-51f0-65cd-4c50ca8f3632" policytype="policy" sessionid=6753380 service="HTTPS" profile="test-example" srcip=192.168.100.177 srcport=53784 srccountry="Reserved" dstip=173.243.143.6 dstport=443 dstcountry="United States" srcintf="lan" srcintfrole="lan" dstintf="wan1" dstintfrole="wan" srcuuid="e2f430d6-7f00-51f0-8d55-e762fbba6612" dstuuid="e2f430d6-7f00-51f0-8d55-e762fbba6612" proto=6 eventsubtype="certificate-probe-failed" hostname="173.243.143.6"这是由于默认配置下,TLS 探测报文使用当前业务 VDOM 下的默认路由出接口。但只有管理 VDOM 的接口可以正常访问 Internet,这样就会造成访问延迟。
解决方法 1
修改 TLS 探测使用的 VDOM 和接口。
config ips global config tls-active-probe set interface-selection-method <auto|sdwan|specify> set interface <intf name> set vdom <vdom name> set source-ip <source_ipv4> set source-ip6 <source_ipv6> end endinterface-selection-method:TLS 探测报文选择接口的方式。auto:默认配置,根据当前 VDOM 下的路由表来进行发送(有多个接口负载分担时,可能会发送到错误的接口);sdwan:匹配 SD-WAN 规则进行发送。specify:手工选择需要发送的方式。
interface:指定发送 TLS 探测报文的接口(当interface-selection-method设置为specify时可选)。vdom:指定发送 TLS 探测报文的 VDOM(当interface-selection-method设置为specify或sdwan时可选)。source-ip/source-ip6:指定发送 TLS 探测报文的源 IPv4/IPv6(当interface-selection-method设置为specify或sdwan时可选)。
此例中,在 Global 下将 TLS 探测的接口改为 root VDOM 的 mgmt 口,可以正常进行 TLS 探测,不会产生超时现象。
config global config ips global config tls-active-probe set interface-select-method specify set vdom root set interface mgmt end end end在 mgmt 接口上抓取的完整的 TLS 探测报文如下。

解决方法 2
如果是 FortiGate 所有接口都不能访问 Internet 的封闭环境,可以关闭 TLS 探测,需要配置自定义 SSL/SSH 配置文件,然后在防火墙策略中引用(出于安全性考虑,不推荐此方法)。
config firewall ssl-ssh-profile
edit "test-example"
config https
set sni-server-cert-check disable
end
next
end
config firewall policy
edit 1
set name "to_Internet"
set ssl-ssh-profile "test-example"
next
endTLS 探测失败默认动作
上文介绍过,在检查基于 TLS 的连接(如 HTTPS)时,FortiGate 需要执行 TLS 证书探测,以便获取服务器的证书并确定用户试图访问的目标域名/地址。若因某些原因导致此 TLS 探测失败(例如 FortiGate 的探测请求无法到达目标 Web 服务器),则 FortiGate 需判断该连接应被阻断还是允许通过。
SSL/SSH 配置文件中的cert-probe-failure选项可以控制此行为:
重要
- 在 FortiOS 7.6.0 之前版本中,
cert-probe-failure的默认动作为block。 - 在 FortiOS 7.6.0 及之后版本中,
cert-probe-failure的默认动作为allow。
config firewall ssl-ssh-profile
edit <profile_name>
config https
set cert-probe-failure <allow|block> <----在7.6.0之前,默认配置为block,在7.6.0及之后,默认动作为allow
end
next
end但在不同的 FortiOS 版本/防火墙策略检测模式(flow/proxy)上,该配置产生的影响存在区别。
- 7.2.11/7.4.5/7.6.1 之前版本(动作 block):
- 代理(proxy)模式: 若 TLS 探测失败,则阻断连接。该选项仅对采用代理(proxy)模式的防火墙策略生效。
- 流(flow)模式:
cert-probe-failure选项会被忽略,此时即使探测失败,系统仍会始终允许连接建立(但可能会产生上文提到的访问延迟)。
- 7.2.11/7.4.5/7.6.1 及之后版本(动作 block):
- 代理(proxy)模式: 若 TLS 探测失败,则阻断连接。
- 流(flow)模式:
cert-probe-failure选项会被考虑,若 TLS 探测失败,则阻断连接,与 proxy 模式保持一致。
产生的问题
如上所述,在 7.2.11/7.4.5/7.6.1 及之后版本开始,cert-probe-failure设置已经对基于流(flow)模式的防火墙策略生效。在常规部署中,通常会使用 flow 模式(默认配置)作为防火墙的检测模式。
如果防火墙之前已存在 TLS 探测失败的的情况,在升级到 7.2.11/7.4.5 后可能会突然出现 TLS 连接问题。此时,转发流量日志将显示 Web 会话被 UTM 阻断。安全事件中的相关 SSL 日志将记录以下信息(certificate-probe-failed、SSL connection is blocked due to unable to retrieve server's certificate):
↓↓↓TLS探测在初始阶段失败,没有具体原因↓↓↓
date=2025-10-16 time=14:20:41 eventtime=1760595641888725921 tz="+0800" logid="1700062305" type="utm" subtype="ssl" eventtype="ssl-anomaly" level="warning" vd="root" action="block" policyid=1 poluuid="04d852a8-7f02-51f0-65cd-4c50ca8f3632" policytype="policy" sessionid=6753380 service="HTTPS" profile="test-example" srcip=192.168.100.177 srcport=53784 srccountry="Reserved" dstip=173.243.143.6 dstport=443 dstcountry="United States" srcintf="lan" srcintfrole="lan" dstintf="wan1" dstintfrole="wan" srcuuid="e2f430d6-7f00-51f0-8d55-e762fbba6612" dstuuid="e2f430d6-7f00-51f0-8d55-e762fbba6612" proto=6 eventsubtype="certificate-probe-failed" hostname="173.243.143.6"
↓↓↓TLS探测在与Server交换证书阶段失败,原因是无法获取服务器证书,可能是因为线路MTU等问题↓↓↓
date=2024-10-03 time=16:00:05 id=7421548890156962227 itime="2024-10-03 16:00:05" euid=3 epid=3 dsteuid=3 dstepid=101 logflag=0 logver=704052702 devid="F2K60FTK21900878" vd="root" type="utm" subtype="ssl" level="warning" sessionid=1749042461 policyid=1735 srcip=172.16.11.37 dstip=54.177.212.176 srcport=53508 dstport=443 proto=6 logid=1700062305 service="SSL" action="blocked" eventtime=1727964004535181139 srcintfrole="wan" dstintfrole="wan" srcintf="port33" dstintf="port19" eventtype="ssl-anomaly" profile="certificate-inspection" hostname="fortinet.com" msg="SSL connection is blocked due to unable to retrieve server's certificate" tz="+0200" eventsubtype="certificate-probe-failed" srcuuid="7aaabd7a-7b3b-51ef-043f-65b562658a6d" dstuuid="83807c12-a3df-51ed-6ed9-2e2613693fe8" sni="fortinet.com" policytype="policy" srccountry="Reserved" dstcountry="United States" poluuid="2df1b1e4-7a4d-51ef-078f-d42cf99bc294" dtime="2024-10-03 16:00:05" itime_t=1727964005 devname="FortiGate-100F"解决方法 1
解决底层 TLS 探测失败问题。如上个章节所示,在大多数情况下,通过检查 FortiGate 用于连接远程 Web 服务器的路由和网络路径,可修复 TLS 探测失败问题。
解决方法 2
如果无法解决 TLS 探测失败问题,则可以创建自定义 SSL/SSH 配置文件,修改cert-probe-failure的动作为 allow(但仍可能会产生上个章节提到的访问延迟),并在相应的防火墙策略中引用该自定义 SSL/SSH 配置文件。
重要
在 FortiOS 7.6.0 及之后版本中,cert-probe-failure的默认动作已经被设置为allow。
config firewall ssl-ssh-profile
edit "test-example"
config https
set cert-probe-failure allow
end
next
end
config firewall policy
edit 1
set name "to_Internet"
set ssl-ssh-profile "test-example"
next
end重要
注意:如果在config ssl中配置了inspect-all(如下所示),则config https中的cert-probe-failure选项会被禁用。
config firewall ssl-ssh-profile
edit "test-example"
config ssl
set inspect-all certificate-inspection
end
next
end解决方法 3
创建自定义 SSL/SSH 配置文件,关闭sni-server-cert-check,禁用 SNI 检查,同时可以禁用 TLS 探测。并在相应的防火墙策略中引用该自定义 SSL/SSH 配置文件。出于安全性考虑,不推荐此方法。
config firewall ssl-ssh-profile
edit "test-example"
config https
set sni-server-cert-check disable
end
next
end
config firewall policy
edit 1
set name "to_Internet"
set ssl-ssh-profile "test-example"
next
end