Obtain SSL information in PHP running as CGI
On many servers, PHP runs as CGI. This is an essential part of using suexec to run the scripts for each site as the user associated with the site. So giving up CGI is not appealing.
But as I understand it the various values such as $_SERVER开发者_开发技巧['SSL_CLIENT_S_DN_CN'] are not set when PHP runs as CGI. This is a pity, as it would be good to have some logic that depended on the presentation of a certificate.
Within a PHP script (PHP as CGI) is there any way to access information about the certificate presented by the user through their browser?
This is an excerpt of the .htaccess file in the Magento root directory:
<IfModule mod_ssl.c>
############################################
## make HTTPS env vars available for CGI mode
SSLOptions StdEnvVars
</IfModule>
I haven't tested it, but the comment is very suggestive, is it not?
精彩评论