1

Good evening my friend I generated san csr via openssl function using php. But i cant get subjectAltName. Please How can i extract subjetAltName from csr?

shell_exec('openssl req -noout -text -in'. $csr)
webprogrammer
  • 2,393
  • 3
  • 21
  • 27
Enge
  • 11
  • 1

1 Answers1

0

I hope this helps:

$r = shell_exec('openssl req -noout -text -in '. $csr)
                                             ^- a space here!

for my test however openssl did not print a Subject Alt Name, so i'll show how to get the Subject:

preg_match('/Subject:\s*(.*)\n/', $r, $matches);
$subject = $matches[1];
ZPiDER
  • 4,264
  • 1
  • 17
  • 17