MT10181 Add debug for CA certificate check & use rest_api_certfile always

Change-Id: I63e129d44a4ff49ea2e9ea06c98f25d25263afba
changes/57/657/1
Alexander Lutay 12 years ago
parent 5c4ec09334
commit 45dc041607

@ -29,7 +29,7 @@ sub COMPONENT {
sub make_client {
my ($self, $c, $serial) = @_;
my $client_key = Path::Tiny->tempfile;
my $command = 'openssl x509 -noout -purpose -in ' . ($c->config->{ssl}->{rest_api_certfile} || $c->config->{ssl}->{certfile});
my $command = 'openssl x509 -noout -purpose -in ' . $c->config->{ssl}->{rest_api_certfile};
$c->log->debug($command);
my ($stdout, $stderr) = capture {
try {
@ -37,6 +37,7 @@ sub make_client {
};
};
unless ($stdout =~ m/SSL (client|server) CA : Yes/) {
$c->log->error("Failed to check CA certificate: $stderr");
die [$c->loc('Cannot use the configured certificate for signing client certificates'), "showdetails"];
}
$command = sprintf 'certtool -p --bits 3248 --outfile %s 1>&- 2>&-', $client_key->stringify;

Loading…
Cancel
Save