wayf-dk / janus-ssp

Automatically exported from code.google.com/p/janus-ssp
Other
0 stars 0 forks source link

Certificate validation cronjob fails when certificate is not configured #299

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run certificate validation cronjob 
(simplesaml/module.php/cron/cron.php?key={key}&tag=daily)

JANUS version: 1.10 branch

Cronjob fails when entity does not have a certificated configured
url. This is because sspmod_janus_EntityController::getCertificate() returns 
false when no certificate is found, however 
sspmod_janus_Cron_Job_ValidateEntityCertificate::runForCronTag() only stops 
executing if an exception is thrown.

The simplest solution would be throwing an exception afterwards like:

$certificate = $entityController->getCertificate();

// @workaround
// Since getCertificate() returns false when certificate does not exist 
following check is required to skip validation
if(empty($certificate)) {
    throw new Exception('No certificate found');
}

I will commit a fix soon

Original issue reported on code.google.com by vanliero...@gmail.com on 10 Nov 2011 at 4:44

GoogleCodeExporter commented 9 years ago
Fixed by r938

I've added a workaround to make sure certificate validation is skipped when no 
certificate was found. Do you think this is ok?

Original comment by vanliero...@gmail.com on 14 Nov 2011 at 10:28

GoogleCodeExporter commented 9 years ago
Merged to trunk in r944

Original comment by vanliero...@gmail.com on 17 Nov 2011 at 9:22

GoogleCodeExporter commented 9 years ago

Original comment by j...@wayf.dk on 24 Nov 2011 at 2:09

GoogleCodeExporter commented 9 years ago

Original comment by j...@wayf.dk on 2 Apr 2012 at 2:11