晚安,我的朋友我使用php通过openssl函数生成了san csr。但是我无法获得subjectAltName。请问如何从csr提取subjetAltName?
shell_exec('openssl req -noout -text -in'. $csr)
我希望这会有所帮助:
$r = shell_exec('openssl req -noout -text -in '. $csr)
^- a space here!
但是,对于我的测试,openssl并未打印主题替代名称,所以我将展示如何获取主题:
preg_match('/Subject:\s*(.*)\n/', $r, $matches);
$subject = $matches[1];