Add index.php

This commit is contained in:
Klaus-Uwe Mitterer 2016-03-04 22:02:10 +01:00
commit 7034d43b6e

18
index.php Normal file
View file

@ -0,0 +1,18 @@
<?php
require("settings.php");
foreach ($sites as $s) {
$g = stream_context_create (array("ssl" => array("capture_peer_cert" => true)));
$r = stream_socket_client("ssl://" . $s . ":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $g);
$p = stream_context_get_params($r);
$c = openssl_x509_parse($p["options"]["ssl"]["peer_certificate"]);
$out = $s . " - " . date("Y-m-d H:i:s",$c["validTo_time_t"]);
if ($c["validTo_time_t"] < strtotime("+1 week")) {
print("<font color=\"red\"><b>" . $out . "</b></font>");
} else {
print($out);
};
print("<br>");
};