pull/2293/head
Guilherme Capilé 2017-06-27 19:56:32 -03:00
parent 4fd5df3b38
commit 794acb987e
1 changed files with 16 additions and 4 deletions

View File

@ -74,10 +74,22 @@ class CertificateAuthenticate extends BaseAuthenticate
unset($CA, $ca);
}
if (self::$ca && isset($_SERVER['SSL_CLIENT_S_DN'])) {
self::$client = self::parse($_SERVER['SSL_CLIENT_S_DN'], Configure::read('CertAuth.map'));
if(isset($_SERVER['SSL_CLIENT_M_SERIAL'])) {
self::$client['serial'] = $_SERVER['SSL_CLIENT_M_SERIAL'];
if (self::$ca) {
$map = Configure::read('CertAuth.map');
if(isset($_SERVER['SSL_CLIENT_S_DN'])) {
self::$client = self::parse($_SERVER['SSL_CLIENT_S_DN'], $map);
} else {
self::$client = array();
}
foreach($map as $n=>$d) {
if(isset($_SERVER[$n])) {
self::$client[$d] = $_SERVER[$n];
}
unset($map[$n], $n, $d);
}
unset($map);
if(!self::$client) {
self::$client = false;
}
}
}