Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$g = stream_context_create ([
"ssl" => ["capture_peer_cert" => true],
'http' => [
'method' => 'GET',
'user_agent' => ' ssl detector',
$r = fopen("", "rb", false, $g);
$cont = stream_context_get_params($r);
$cert = openssl_x509_parse($cont["options"]["ssl"]["peer_certificate"]);
echo $cert['subject']['CN'], "\n";
echo date('Y-m-d H:i:s', $cert['validFrom_time_t']), "\n";
echo date('Y-m-d H:i:s', $cert['validTo_time_t']), "\n";
echo $cert['issuer']['O'],"\n";
echo $cert['issuer']['CN'],"\n";

This comment has been minimized.

Copy link
Owner Author

@shiny shiny commented Apr 11, 2018

2017-06-29 08:00:00
2018-08-18 07:59:59
Symantec Corporation
Symantec Class 3 Secure Server CA - G4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment