File: san.t

package info (click to toggle)
libcrypt-openssl-x509-perl 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 800 kB
  • sloc: perl: 152; makefile: 3; sh: 1
file content (25 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use Test::More tests => 17;

BEGIN { use_ok('Crypt::OpenSSL::X509') };

my @files = <certs/*.pem>;
foreach my $file (@files) {
    
  if ($file eq 'certs/broken-utf8.pem') {
    next;
  }

  ok(my $x509 = Crypt::OpenSSL::X509->new_from_file($file), 'new_from_file()');
  my $san = $x509->subjectaltname;

  ok ($san, 'subjectaltname call succeeded');

  # Mostly for debugging but this could be commented out
  foreach my $sanname (@$san) {
    for (keys %$sanname){
      print("    Found $_: ", $sanname->{$_}, "\n");
    }
  }
}