Add the username as the first SAN when making a user certificate from the user manager creation screen. Fixes #7666

This commit is contained in:
jim-p 2017-07-05 13:29:55 -04:00
parent 2e1809ddc3
commit b767fe6cdf

View File

@ -411,6 +411,10 @@ if ($_POST['save']) {
'organizationName' => $subject[3]['v'],
'emailAddress' => $subject[4]['v'],
'commonName' => $userent['name']);
$altnames_tmp = array(cert_add_altname_type($userent['name']));
if (!empty($altnames_tmp)) {
$dn['subjectAltName'] = implode(",", $altnames_tmp);
}
cert_create($cert, $_POST['caref'], $_POST['keylen'],
(int)$_POST['lifetime'], $dn);