Skip to content

Commit

Permalink
Categorise self-signed certificates as a single issuer rather than as…
Browse files Browse the repository at this point in the history
… many unique issuers.
  • Loading branch information
iay committed Aug 24, 2009
1 parent 0869a54 commit 405182c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build/probe_certs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,26 @@
#
# Use openssl to convert the certificate to text
#
my(@lines, $issuer, $subjectCN, $issuerCN);
my(@lines, $subject, $issuer);
$cmd = "openssl x509 -in $temp_der -inform der -noout -text -nameopt RFC2253 -modulus |";
open(SSL, $cmd) || die "could not open openssl subcommand";
while (<SSL>) {
push @lines, $_;
if (/^\s*Issuer:\s*(.*)$/) {
$issuer = $1;
#print "$hostPort: issuer is $issuer\n";
$issuers{$issuer}{$loc} = 1;
$numissued++;
if ($issuer =~ /CN=([^,]+)/) {
$issuerCN = $1;
} else {
$issuerCN = $issuer;
}
}
if (/^\s*Subject:\s*(.*)$/) {
$subject = $1;
}
}

if ($subject eq $issuer) {
$issuer = "(self signed certificate)";
}

$issuers{$issuer}{$loc} = 1;
$numissued++;
}
print "\n\n";

Expand Down

0 comments on commit 405182c

Please sign in to comment.