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