184 |
nametemplate_der nametemplate_pem |
nametemplate_der nametemplate_pem |
185 |
cadir catemplate statedir |
cadir catemplate statedir |
186 |
/ ) { |
/ ) { |
187 |
$self->{$key} = |
$self->{$key} = $self->{$key} || |
188 |
$::cnf->{$self->{"alias"}}->{$key} || |
$::cnf->{$self->{"alias"}}->{$key} || |
189 |
$::cnf->{$self->{"anchorname"}}->{$key} || |
$::cnf->{$self->{"anchorname"}}->{$key} || |
190 |
$::cnf->{_}->{$key} or delete $self->{$key}; |
$::cnf->{_}->{$key} or delete $self->{$key}; |
269 |
my $self = shift; |
my $self = shift; |
270 |
my $idx = 0; |
my $idx = 0; |
271 |
|
|
272 |
-d $self->{"cadir"} or |
# try to find a CA dir, whatever it takes, almost |
273 |
$::log->err("CA directory",$self->{"cadir"},"does not exist") and |
my $cadir = $self->{"cadir"} || $self->{"infodir"}; |
274 |
|
|
275 |
|
-d $cadir or |
276 |
|
$::log->err("CA directory",$cadir,"does not exist") and |
277 |
return 0; |
return 0; |
278 |
|
|
279 |
@{$self->{"cafile"}} = (); |
@{$self->{"cafile"}} = (); |
281 |
my $cafile; |
my $cafile; |
282 |
foreach my $catpl ( split /&/, $self->{"catemplate"} ) { |
foreach my $catpl ( split /&/, $self->{"catemplate"} ) { |
283 |
$catpl =~ s/\@R\@/$idx/g; |
$catpl =~ s/\@R\@/$idx/g; |
284 |
-e $self->{"cadir"}.'/'.$catpl and |
-e $cadir.'/'.$catpl and |
285 |
$cafile = $self->{"cadir"}.'/'.$catpl and last; |
$cafile = $cadir.'/'.$catpl and last; |
286 |
} |
} |
287 |
defined $cafile or do { |
defined $cafile or do { |
288 |
$idx or do $::log->err("Cannot find any CA for", |
$idx or do $::log->err("Cannot find any CA for", |
289 |
$self->{"alias"},"in",$self->{"cadir"}); |
$self->{"alias"},"in",$cadir); |
290 |
return $idx?1:0; |
return $idx?1:0; |
291 |
}; |
}; |
292 |
push @{$self->{"cafile"}}, $cafile; |
push @{$self->{"cafile"}}, $cafile; |
535 |
# be used for all (like Last-Modified, and cache control data) |
# be used for all (like Last-Modified, and cache control data) |
536 |
|
|
537 |
# if we have a cached piece of fresh data, return that one |
# if we have a cached piece of fresh data, return that one |
538 |
if ( ($self->{"crl"}[$i]{"state"}{"freshuntil"} || 0) > time and |
if ( !$self->{"nocache"} and |
539 |
|
($self->{"crl"}[$i]{"state"}{"freshuntil"} || 0) > time and |
540 |
$self->{"crl"}[$i]{"state"}{"b64data"} ) { |
$self->{"crl"}[$i]{"state"}{"b64data"} ) { |
541 |
$::log->verb(3,"Using cached content for",$self->{"alias"},"index",$i); |
$::log->verb(3,"Using cached content for",$self->{"alias"},"index",$i); |
542 |
$::log->verb(4,"Content dated", |
$::log->verb(4,"Content dated", |
609 |
|
|
610 |
$self->{"crl"}[$i]{"state"}{"retrievaltime"} = time; |
$self->{"crl"}[$i]{"state"}{"retrievaltime"} = time; |
611 |
$self->{"crl"}[$i]{"state"}{"sourceurl"} = $response{"sourceurl"}||"null:"; |
$self->{"crl"}[$i]{"state"}{"sourceurl"} = $response{"sourceurl"}||"null:"; |
612 |
$self->{"crl"}[$i]{"state"}{"freshuntil"} = |
$self->{"crl"}[$i]{"state"}{"freshuntil"} = $response{"freshuntil"}||time; |
|
($self->{"nocache"}? 0 : $response{"freshuntil"}||time); |
|
613 |
$self->{"crl"}[$i]{"state"}{"lastmod"} = $response{"lastmod"}||time; |
$self->{"crl"}[$i]{"state"}{"lastmod"} = $response{"lastmod"}||time; |
614 |
|
|
615 |
} |
} |