1 # +------------------------------------+
2 # | Inspire Internet Relay Chat Daemon |
3 # +------------------------------------+
5 # InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 # See: http://wiki.inspircd.org/Credits
8 # This program is free but copyrighted software; see
9 # the file COPYING for details.
11 # ---------------------------------------------------
13 package make::opensslcert;
18 use warnings FATAL => qw(all);
20 use Exporter 'import';
22 our @EXPORT = qw(make_openssl_cert);
25 sub make_openssl_cert()
27 open (FH, ">openssl.template");
28 my $org = promptstring_s("Please enter the organization name", "My IRC Network");
29 my $unit = promptstring_s("Please enter the unit Name", "Server Admins");
30 my $country = promptstring_s("Please enter your country (two letter code)", "US");
31 my $state = promptstring_s("Please enter your state or locality name", "Alaska");
32 my $city = promptstring_s("Please enter your city", "Factory Town");
33 my $email = promptstring_s("Please enter a contact email address", "oompa\@loompa.com");
34 my $commonname = promptstring_s("Please enter the common name (domain name) of the irc server", "example.inspircd.org");
46 my $time = promptstring_s("Please enter the number of days that this certificate is valid for","365");
48 system("cat openssl.template | openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem -days $time 2>/dev/null");
49 system("openssl dhparam -out dhparams.pem 1024");
50 unlink("openssl.template");