Moved certs to etc/certs.
This commit is contained in:
1 parent
42d8b68f86
commit
b2ad80b097
1 file changed
+7
-3
+7
-3
@@ -18,12 +18,16 @@ my $net = <STDIN>;
|
|||||||
$net =~ s/(\r|\n)//gxsm;
|
$net =~ s/(\r|\n)//gxsm;
|
||||||
say q{};
|
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.
|
# Generate key and cert.
|
||||||
system 'openssl req -nodes -newkey rsa:2048 -keyout '.$bin.'/../etc/'.$net.'.key -x509 -days 3650 -out '.$bin.'/../etc/'.$net.'.cert';
|
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/$net.key";
|
chmod 0400, "$bin/../etc/certs/$net.key";
|
||||||
|
|
||||||
# Get the fingerprint.
|
# 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;
|
my $fp;
|
||||||
while ($fpr =~ s/(.*\n)//) {
|
while ($fpr =~ s/(.*\n)//) {
|
||||||
my $line = $1;
|
my $line = $1;
|
||||||
|
|||||||
Reference in new issue
Block a user