summaryrefslogtreecommitdiff
path: root/FS/FS/svc_cert.pm
diff options
context:
space:
mode:
authorivan <ivan>2010-11-08 00:01:58 +0000
committerivan <ivan>2010-11-08 00:01:58 +0000
commite50b6ec8d63afe4c04ae33384758d8786fcc7cfe (patch)
tree37cce8990845f0618d51137fbfa613fb0a50d850 /FS/FS/svc_cert.pm
parent874ad675da1321638b374d0b574231d7fa577196 (diff)
certificates ala communigate, RT#7515
Diffstat (limited to 'FS/FS/svc_cert.pm')
-rw-r--r--FS/FS/svc_cert.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/svc_cert.pm b/FS/FS/svc_cert.pm
index 36e7582..b77ff52 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'