]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - make/opensslcert.pm
Fixed the order of fields in openssl certificate generation; this would make really...
[user/henk/code/inspircd.git] / make / opensslcert.pm
1 package make::opensslcert;
2
3 use Exporter 'import';
4 use make::configure;
5 @EXPORT = qw(make_openssl_cert);
6
7
8 sub make_openssl_cert()
9 {
10         open (FH, ">openssl.template");
11         my $org = promptstring_s("Please enter the organization name", "My IRC Network");
12         my $unit = promptstring_s("Please enter the unit Name", "Server Admins");
13         my $state = promptstring_s("Please enter your state or locality name", "Alaska");
14         my $country = promptstring_s("Please enter your country (two letter code)", "US");
15         my $city = promptstring_s("Please enter your city", "Factory Town");
16         my $email = promptstring_s("Please enter a contact email address", "oompa\@loompa.com");
17         my $commonname = promptstring_s("Please enter the common name (domain name) of the irc server", "example.inspircd.org");
18         print FH <<__END__;
19 $country
20 $state
21 $city
22 $org
23 $unit
24 $commonname
25 $email
26 __END__
27 close(FH);
28 system("cat openssl.template | openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem 2>/dev/null");
29 system("openssl dhparam -out dhparams.pem 1024");
30 unlink("openssl.template");
31 }
32
33 1;