#include <credentials/certificates/ocsp_request.h>
#include <credentials/certificates/ocsp_response.h>
+/* number of fetch timeouts to degrade a CRL fetch after a failure */
+#define CRL_DEGRADATION_TIMES 3
+
typedef struct private_revocation_fetcher_t private_revocation_fetcher_t;
/**
*/
u_int fetchers;
+ /**
+ * Has the previous fetch failed, until when is this URL degraded?
+ */
+ time_t failing;
+
/**
* CRL received in the currently active fetch.
*/
crl = do_crl_fetch(this, fetch->url, timeout);
this->mutex->lock(this->mutex);
fetch->crl = crl;
+ if (crl)
+ {
+ fetch->failing = 0;
+ }
+ else
+ {
+ fetch->failing = time_monotonic(NULL) + timeout * CRL_DEGRADATION_TIMES;
+ }
while (fetch->fetchers > 1)
{
fetch->condvar->signal(fetch->condvar);
{
certificate_t *crl = NULL;
+ if (fetch->failing && fetch->failing > time_monotonic(NULL))
+ {
+ DBG1(DBG_CFG, " crl fetch from '%s' recently failed, skipping",
+ fetch->url);
+ return NULL;
+ }
DBG1(DBG_CFG, " waiting for crl fetch from '%s' ...", fetch->url);
if (fetch->crl)
{