diff options
author | ivan <ivan> | 2010-11-08 00:01:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-11-08 00:01:59 +0000 |
commit | 1fe4570cf952ba3f4162f041b2bcaf8a92330505 (patch) | |
tree | a5b393542cd47945e4aaed6d887292ff6aa76a0b /FS | |
parent | 9d8fe677d8b1aa8273d5379e14da325e33d52bb4 (diff) |
certificates ala communigate, RT#7515
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/svc_cert.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/svc_cert.pm b/FS/FS/svc_cert.pm index 36e7582a6..b77ff521d 100644 --- a/FS/FS/svc_cert.pm +++ b/FS/FS/svc_cert.pm @@ -335,10 +335,13 @@ sub generate_selfsigned { #notAfter=Nov 6 05:07:42 2012 GMT #serial=B1DBF1A799EF207B -sub check_certificate { - my $self = shift; +sub check_certificate { shift->check_x509('certificate'); } +sub check_cacert { shift->check_x509('cacert'); } + +sub check_x509 { + my( $self, $field ) = ( shift, shift ); - my $in = $self->certificate; + my $in = $self->$field; run( [qw( openssl x509 -noout -subject -issuer -dates -serial )], '<'=>\$in, '>pipe'=>\*OUT, '2>'=>'/dev/null' |