Moved certs to etc/certs.

This commit is contained in:
Elijah Perrault committed 2011-02-09 14:30:13 -07:00
1 parent 42d8b68f86
commit b2ad80b097
1 file changed
+7 -3
+7 -3
View File
@@ -18,12 +18,16 @@ my $net = <STDIN>;
$net =~ s/(\r|\n)//gxsm;
say q{};
# Make sure etc/certs/ exists.
if (!-d "$bin/../etc") { mkdir "$bin/../etc", 0755; }
if (!-d "$bin/../etc/certs") { mkdir "$bin/../etc/certs", 0755; }
# Generate key and cert.
system 'openssl req -nodes -newkey rsa:2048 -keyout '.$bin.'/../etc/'.$net.'.key -x509 -days 3650 -out '.$bin.'/../etc/'.$net.'.cert';
chmod 0400, "$bin/../etc/$net.key";
system 'openssl req -nodes -newkey rsa:2048 -keyout '.$bin.'/../etc/certs/'.$net.'.key -x509 -days 3650 -out '.$bin.'/../etc/certs/'.$net.'.cert';
chmod 0400, "$bin/../etc/certs/$net.key";
# Get the fingerprint.
my $fpr = `openssl x509 -noout -fingerprint -text < $bin/../etc/$net.cert`;
my $fpr = `openssl x509 -noout -fingerprint -text < $bin/../etc/certs/$net.cert`;
my $fp;
while ($fpr =~ s/(.*\n)//) {
my $line = $1;