简体   繁体   English

如何获得SSL协议版本(php)

[英]How to get SSL protocol version (php)

I've got a server Apache/2.2.22 (Debian) with PHP/5.4.45-0+deb7u5. 我有一台服务器Apache / 2.2.22(Debian),PHP / 5.4.45-0 + deb7u5。

I need to get a php environment variable that specifies which SSL protocol version is used between client and server (I mean TLS 1.1, TLS 1.2 etc.). 我需要一个php环境变量来指定客户端和服务器之间使用的SSL协议版本(我的意思是TLS 1.1,TLS 1.2等)。

So, I will use that variable in a script to get different options using TLS 1.1 or TLS 1.2 etc... 因此,我将在脚本中使用该变量来使用TLS 1.1或TLS 1.2等获取不同的选项...

That server has got OpenSSL/1.0.1t. 该服务器已获得OpenSSL / 1.0.1t。

The SSL_PROTOCOL environment variable should have what you're looking for. SSL_PROTOCOL环境变量应该具有您正在寻找的内容。 It's documented in the Apache manual for mod_ssl , along with other SSL variables. 它已在Apache手册中记录了mod_ssl以及其他SSL变量。

Note that some hosting environments may not make this variable available. 请注意,某些托管环境可能无法使此变量可用。 If you don't see it, you may need to add SSLOptions +StdEnvVars to your web server configuration, or to an .htaccess file. 如果您没有看到它,则可能需要将SSLOptions +StdEnvVars添加到Web服务器配置或.htaccess文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP 8 $_SERVER['SSL_PROTOCOL'] 在某些服务器上丢失,如何确定加密协议和版本 - PHP 8 $_SERVER['SSL_PROTOCOL'] is missing on some servers, how to determine encryption protocl and version 如何确定tls / ssl安全协议连接到LDAP(PHP)的版本? - How to determine what version tls/ssl security protocol is connecting to LDAP (PHP)? PayPal-PHP-SDK中不支持的SSL协议版本 - Unsupported SSL protocol version in PayPal-PHP-SDK '不支持的SSL协议版本'Curl OpenSSL版本混乱(PayPal API PHP PHP) - 'Unsupported SSL protocol version' Curl OpenSSL version confusion (paypal api php sdk) PHP:获取HTTP协议版本(HTTP / 1.1与HTTP / 2) - PHP: Get HTTP Protocol Version (HTTP/1.1 vs HTTP/2) cURL错误:[35]不支持的SSL协议版本 - cURL error: [35] Unsupported SSL protocol version OpenSSL 错误消息:错误:1407742E:SSL 例程:SSL23_GET_SERVER_HELLO:tlsv1 警报协议版本 - OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version 如何获得 PHP 版本? - How to get the PHP Version? 如何通过php获取网页的开放图协议? - How to get Open Graph Protocol of a webpage by php? Facebook PHP SDK:未知的 SSL 协议错误 - Facebook PHP SDK: Unknown SSL protocol error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM