dougm 02/03/29 18:17:21
Modified: perl-framework/Apache-Test/lib/Apache TestSSLCA.pm
Log:
generate certs for use by proxy
Revision Changes Path
1.11 +31 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm
Index: TestSSLCA.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TestSSLCA.pm 8 Mar 2002 18:19:55 -0000 1.10
+++ TestSSLCA.pm 30 Mar 2002 02:17:21 -0000 1.11
@@ -150,7 +150,7 @@
}
}
-my @dirs = qw(keys newcerts certs crl export csr conf);
+my @dirs = qw(keys newcerts certs crl export csr conf proxy);
sub init {
for my $dir (@dirs) {
@@ -319,6 +319,32 @@
openssl ca => "-gencrl -out $cacrl", @args;
}
+sub make_proxy_cert {
+ my $name = shift;
+
+ my $from = "certs/$name.crt";
+ my $to = "proxy/$name.pem";
+
+ info "generating proxy cert: $to";
+
+ my $fh_to = Symbol::gensym();
+ my $fh_from = Symbol::gensym();
+
+ open $fh_to, ">$to" or die "open $to: $!";
+ open $fh_from, $from or die "open $from: $!";
+
+ cp $fh_from, $fh_to;
+
+ $from = "keys/$name.pem";
+
+ open $fh_from, $from or die "open $from: $!";
+
+ cp $fh_from, $fh_to;
+
+ close $fh_from;
+ close $fh_to;
+}
+
sub setup {
$CA = shift;
@@ -346,6 +372,10 @@
if ($name =~ /_revoked$/) {
revoke_cert($name);
+ }
+
+ if ($name =~ /^client_/) {
+ make_proxy_cert($name);
}
}
}