简体   繁体   English

PHP 8 $_SERVER['SSL_PROTOCOL'] 在某些服务器上丢失,如何确定加密协议和版本

[英]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']变量。

  • I couldn't find any reference to it on php.net.我在 php.net 上找不到任何对它的引用。
  • I am aware that some variables are pulled from other parts of the system though I'm not familiar with where PHP gets this particular variable from.我知道一些变量是从系统的其他部分提取的,尽管我不熟悉 PHP 从哪里获得这个特定变量。
  • All search results I've found using quote operators revealed only irrelevant data.我使用引号运算符找到的所有搜索结果都只显示了不相关的数据。
  • I attempted to see if the variable name was changed to something like 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.

相关问题 如何确定tls / ssl安全协议连接到LDAP(PHP)的版本? - How to determine what version tls/ssl security protocol is connecting to LDAP (PHP)? 如何获得SSL协议版本(php) - How to get SSL protocol version (php) PayPal-PHP-SDK中不支持的SSL协议版本 - Unsupported SSL protocol version in PayPal-PHP-SDK 如何确定哪个服务器更适合使用PHP在CDN服务器上下载分布式文件? - How to determine which server is more suitable for downloading distributed files on CDN servers using PHP? 为我的简单书面php套接字服务器编写用于SSL加密的包装器 - Write a wrapper for ssl encryption to my simple written php socket server 如何简单检查服务器PHP版本是否为5或更高版本? - How to simply check if servers PHP version is 5 or above? '不支持的SSL协议版本'Curl OpenSSL版本混乱(PayPal API PHP PHP) - 'Unsupported SSL protocol version' Curl OpenSSL version confusion (paypal api php sdk) https 版本上的 Laravel Echo Server 和 net::ERR_SSL_PROTOCOL_ERROR - Laravel Echo Server and net::ERR_SSL_PROTOCOL_ERROR on https version OpenSSL 错误消息:错误:1407742E:SSL 例程:SSL23_GET_SERVER_HELLO:tlsv1 警报协议版本 - OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version cURL错误:[35]不支持的SSL协议版本 - cURL error: [35] Unsupported SSL protocol version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM