[英]PHP 8 $_SERVER['SSL_PROTOCOL'] is missing on some servers, how to determine encryption protocl and version
We recently upgraded our servers to PHP 8 and on one of the servers the $_SERVER['SSL_PROTOCOL']
variable is missing.我们最近将服务器升级到 PHP 8 并且在其中一台服务器上缺少$_SERVER['SSL_PROTOCOL']
变量。
TLS_PROTOCOL
because SSL has been irrelevant for some time.我试图查看变量名称是否更改为类似TLS_PROTOCOL
的名称,因为 SSL 已经有一段时间了。 My goal is to ensure that clients are using TLS 1.2 or TLS 1.3 and this was the critical component to that.我的目标是确保客户端使用 TLS 1.2 或 TLS 1.3,这是其中的关键组件。 How do I either get $_SERVER['SSL_PROTOCOL']
or at least determine the protocol and protocol version of the network encryption type being used by clients via PHP?如何获取$_SERVER['SSL_PROTOCOL']
或至少确定客户端通过 PHP 使用的网络加密类型的协议和协议版本?
The SSL/TLS encryption is handled by your web server, not by PHP, so this variable has to be set there. SSL/TLS 加密由您的 web 服务器处理,而不是由 PHP 处理,因此必须在此处设置此变量。 The upgrade of PHP is coincidence - it's something else you've upgraded or re-built that has caused the difference. PHP 的升级是巧合 - 这是您升级或重建的其他东西导致了差异。
If you are using Apache, this information is disabled for performance unless you set SSLOptions +StdEnvVars
.如果您使用的是 Apache,则除非您设置SSLOptions +StdEnvVars
,否则此信息将被禁用以提高性能。 See the documentation at https://httpd.apache.org/docs/current/mod/mod_ssl.html请参阅https://httpd.apache.org/docs/current/mod/mod_ssl.html上的文档
A quick search suggests Nginx doesn't set this variable natively at all.快速搜索表明 Nginx 根本没有设置这个变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.