[英]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.