Skip to content
Snippets Groups Projects
Commit c9006018 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Reporting more errors in certcheck

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1231 44740490-163a-0410-bde0-09ae8108e29a
parent 936ba773
No related branches found
No related tags found
No related merge requests found
......@@ -22,22 +22,36 @@ $classes = array('odd', 'even');
foreach($this->data['results'] as $orgkey => $org) {
echo('<tr class="' . ($classes[($i++ % 2)]) . '">');
echo '<td>' . $orgkey . '</td><td>' . $org . ' days</td><td>';
if ($org < 30) {
echo '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" />';
if (array_key_exists('error', $this->data['resultsm'][$orgkey])) {
echo '<td colspan="2">' . $orgkey . '</td><td>';
echo '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" /></td>';
echo '<td colspan="2">' . $this->data['resultsm'][$orgkey]['error'];
echo '</td>';
} else {
echo '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" />';
}
echo '</td>';
echo '<td>';
if (array_key_exists('expire', $this->data['resultsm'][$orgkey])) echo $this->data['resultsm'][$orgkey]['expire'];
echo '</td>';
echo '<td>';
if (array_key_exists('issuer', $this->data['resultsm'][$orgkey])) echo $this->data['resultsm'][$orgkey]['issuer'];
echo '</td>';
echo '<td>' . $orgkey . '</td><td>' . $org . ' days</td><td>';
if ($org < 30) {
echo '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" />';
} else {
echo '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" />';
}
echo '</td>';
echo '<td>';
if (array_key_exists('expire', $this->data['resultsm'][$orgkey])) echo $this->data['resultsm'][$orgkey]['expire'];
echo '</td>';
echo '<td>';
if (array_key_exists('issuer', $this->data['resultsm'][$orgkey])) echo $this->data['resultsm'][$orgkey]['issuer'];
echo '</td>';
}
echo('</tr>');
}
?>
</table>
......
......@@ -59,7 +59,11 @@ foreach ($orgs AS $orgkey => $orgconfig) {
# echo 'pinging ' . $host . ' port ' . $port;
$ping = phpping($host, $port);
if ($ping[0] === FALSE) continue;
if ($ping[0] === FALSE) {
$results[$host] = 0;
$resultsm[$host]['error'] = 'No connectivity (ping) [' . $host . ':' . $port . ']';
continue;
}
$cmd = 'echo "" | openssl s_client -connect ' . $host . ':' . $port . ' 2> /dev/null | openssl x509 -enddate -noout';
......@@ -72,7 +76,14 @@ foreach ($orgs AS $orgkey => $orgconfig) {
// echo $output; exit;
if (preg_match('/issuer=(.{0,40})/', $output2, $matches) ) {
$resultsm[$host]['issuer'] = $matches[1];
} else {
$results[$host] = 0;
$resultsm[$host]['error'] = 'Did not find Issuer in response [' . $host . ':' . $port . ']';
}
} else {
$results[$host] = 0;
$resultsm[$host]['error'] = 'Empty output from s_client -connect [' . $host . ':' . $port . ']';
}
if (preg_match('/notAfter=(.*)/', $output, $matches) ) {
......@@ -85,7 +96,6 @@ foreach ($orgs AS $orgkey => $orgconfig) {
$results[$host] = $days;
$resultsm[$host]['expire'] = date('jS F Y', strtotime($rawdate));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment