X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_cert.pm;h=b77ff521de14411a46a133b6e0fcf00ac35f006c;hp=36e7582a664fd4c09c95048777534faa5e5e96de;hb=e50b6ec8d63afe4c04ae33384758d8786fcc7cfe;hpb=874ad675da1321638b374d0b574231d7fa577196 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'