summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-11-17 22:59:17 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-11-17 22:59:17 +0000
commit13128695a840b228e56a813b5af44f135f33f02e (patch)
tree384bfb24bb10c1ad150b6a165fa224949aaf0cd7
parent965aefa2cdd6a8b8b0d27a636b3202cac02604f5 (diff)
downloadpfsense-13128695a840b228e56a813b5af44f135f33f02e.zip
pfsense-13128695a840b228e56a813b5af44f135f33f02e.tar.gz
Create certificate for HTTP Server option
-rw-r--r--etc/ssl/openssl.cnf265
-rwxr-xr-xusr/local/www/system_advanced.php117
-rwxr-xr-xusr/local/www/system_advanced_create_certs.php207
3 files changed, 531 insertions, 58 deletions
diff --git a/etc/ssl/openssl.cnf b/etc/ssl/openssl.cnf
new file mode 100644
index 0000000..a1dcfe8
--- /dev/null
+++ b/etc/ssl/openssl.cnf
@@ -0,0 +1,265 @@
+# $FreeBSD: src/crypto/openssl/apps/openssl.cnf,v 1.6 2004/03/17 17:44:38 nectar Exp $
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+#
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+#crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem# The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = md5 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+distinguished_name=req_distinguished_name
+req_extensions = v3_req
+prompt=no
+
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+#input_password=""
+#output_password=""
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = US
+#countryName_default = AU
+#countryName_min = 2
+#countryName_max = 2
+
+stateOrProvinceName = Somewhere
+#stateOrProvinceName_default = Somestate
+
+localityName = Somecity
+
+0.organizationName = CompanyName
+#0.organizationName_default = SampleNameDefault
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+#organizationalUnitName_default =
+
+commonName = Common Name (eg, YOUR name)
+#commonName_max = 64
+
+emailAddress = Email Address
+#emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+#challengePassword_min = 4
+#challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index dbc665a..33a4700 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -1,22 +1,22 @@
#!/usr/local/bin/php
-<?php
+<?php
/*
system_advanced.php
part of m0n0wall (http://m0n0.ch/wall)
-
+
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -82,9 +82,9 @@ if ($_POST) {
}
$config['system']['webgui']['noantilockout'] = $_POST['noantilockout'] ? true : false;
$config['filter']['tcpidletimeout'] = $_POST['tcpidletimeout'];
-
+
write_config();
-
+
if (($config['system']['webgui']['certificate'] != $oldcert)
|| ($config['system']['webgui']['private-key'] != $oldkey)) {
touch($d_sysrebootreqd_path);
@@ -98,7 +98,7 @@ if ($_POST) {
system_set_harddisk_standby();
}
}
-
+
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
@@ -130,91 +130,92 @@ function enable_change(enable_over) {
</head>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<form action="system_advanced.php" method="post" name="iform" id="iform">
<?php include("fbegin.inc"); ?>
<p class="pgtitle">System: Advanced functions</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
- <p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the
- options on this page are intended for use by advanced users only,
+ <p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the
+ options on this page are intended for use by advanced users only,
and there's <strong>NO</strong> support for them.</span></p>
- <form action="system_advanced.php" method="post" name="iform" id="iform">
+
<table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)">
- <strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893)
- to:</strong><br> <br> <input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>">
+ <td width="78%" class="vtable">
+ <input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)">
+ <strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893)
+ to:</strong><br> <br> <input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>">
&nbsp;(IP address)<span class="vexpl"><br>
Don't forget to add a firewall rule to permit IPv6 packets!</span></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
</tr>
- <tr>
+ <tr>
<td colspan="2" class="list" height="12"></td>
</tr>
- <tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic">Filtering bridge</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="filteringbridge_enable" type="checkbox" id="filteringbridge_enable" value="yes" <?php if ($pconfig['filteringbridge_enable']) echo "checked"; ?>>
<strong>Enable filtering bridge</strong><span class="vexpl"><br>
- This will cause bridged packets to pass through the packet
- filter in the same way as routed packets do (by default bridged
- packets are always passed). If you enable this option, you'll
- have to add filter rules to selectively permit traffic from
+ This will cause bridged packets to pass through the packet
+ filter in the same way as routed packets do (by default bridged
+ packets are always passed). If you enable this option, you'll
+ have to add filter rules to selectively permit traffic from
bridged interfaces.</span></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
</tr>
- <tr>
+ <tr>
<td colspan="2" class="list" height="12"></td>
</tr>
- <tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Certificate</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
- <br>
- Paste a signed certificate in X.509 PEM format here.</td>
+ <br>
+ Paste a signed certificate in X.509 PEM format here. <A target="_new" HREF='system_advanced_create_certs.php'>Create</a> certificates automatically.</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Key</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
- <br>
+ <br>
Paste an RSA private key in PEM format here.</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
</tr>
- <tr>
+ <tr>
<td colspan="2" class="list" height="12"></td>
</tr>
- <tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Console menu </td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>>
<strong>Disable console menu</strong><span class="vexpl"><br>
Changes to this option will take effect after a reboot.</span></td>
@@ -234,9 +235,9 @@ function enable_change(enable_over) {
Idle TCP connections will be removed from the state table after no packets have been received for the specified number of seconds. Don't set this too high or your state table could become full of connections that have been improperly shut down. The default is 2.5 hours.</span></td>
</tr>
<?php if ($g['platform'] == "generic-pc"): ?>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<select name="harddiskstandby" class="formfld">
<?php
/* Values from ATA-2
@@ -256,25 +257,25 @@ function enable_change(enable_over) {
access has elapsed. <em>Do not set this for CF cards.</em></td>
</tr>
<?php endif; ?>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Navigation</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="expanddiags" type="checkbox" id="expanddiags" value="yes" <?php if ($pconfig['expanddiags']) echo "checked"; ?>>
<strong>Keep diagnostics in navigation expanded </strong></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?>>
<strong>Disable webGUI anti-lockout rule</strong><br>
By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you in, or you will lock yourself out!).<br>
- Hint:
+ Hint:
the &quot;set LAN IP address&quot; option in the console menu resets this setting as well.</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
</tr>
</table>
diff --git a/usr/local/www/system_advanced_create_certs.php b/usr/local/www/system_advanced_create_certs.php
new file mode 100755
index 0000000..4192c79
--- /dev/null
+++ b/usr/local/www/system_advanced_create_certs.php
@@ -0,0 +1,207 @@
+#!/usr/local/bin/php
+<?php
+/*
+ system_advanced_create_certs.php
+ part of pfSense
+
+ Copyright (C) 2004 Scott Ullrich
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+
+$fd = fopen("/etc/ssl/openssl.cnf", "r");
+$openssl = fread($fd,8096);
+fclose($fd);
+
+preg_match('/\nC\=(.*)\n/', $openssl, $countrycodeA);
+preg_match('/\nST\=(.*)\n/', $openssl, $stateorprovinceA);
+preg_match('/\nL\=(.*)\n/', $openssl, $citynameA);
+preg_match('/\nO\=(.*)\n/', $openssl, $orginizationnameA);
+preg_match('/\nOU\=(.*)\n/', $openssl, $orginizationdepartmentA);
+preg_match('/\nCN\=(.*)\n/', $openssl, $commonnameA);
+
+$countrycode = $countrycodeA[1];
+$stateorprovince = $stateorprovinceA[1];
+$cityname = $citynameA[1];
+$orginizationname = $orginizationnameA[1];
+$orginizationdepartment = $orginizationdepartmentA[1];
+$commonname = $commonnameA[1];
+
+if ($_POST) {
+
+ /* Create a new openssl.cnf */
+ $countrycode=$_POST['countrycode'];
+ $stateorprovince=$_POST['stateorprovince'];
+ $cityname=$_POST['cityname'];
+ $orginizationname=$_POST['orginizationname'];
+ $orginizationdepartment=$_POST['orginizationdepartment'];
+ $commonname=$_POST['commonname'];
+
+ $fd = fopen("/etc/ssl/openssl.cnf", "w");
+ fwrite($fd, "");
+ fwrite($fd, "[ req ]\n");
+ fwrite($fd, "distinguished_name=req_distinguished_name \n");
+ fwrite($fd, "req_extensions = v3_req \n");
+ fwrite($fd, "prompt=no \n");
+ fwrite($fd, "[ req_distinguished_name ] \n");
+ fwrite($fd, "C=" . $countrycode . " \n");
+ fwrite($fd, "ST=" . $stateorprovince. " \n");
+ fwrite($fd, "L=" . $cityname . " \n");
+ fwrite($fd, "O=" . $orginizationname . " \n");
+ fwrite($fd, "OU=" . $orginizationdepartment . " \n");
+ fwrite($fd, "CN=" . $commonname . " \n");
+ fwrite($fd, "[EMAIL PROTECTED] \n");
+ fwrite($fd, "[EMAIL PROTECTED] \n");
+ fwrite($fd, "[ v3_req ] \n");
+ fwrite($fd, "basicConstraints = critical,CA:FALSE \n");
+ fwrite($fd, "keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment, keyAgreement \n");
+ fwrite($fd, "extendedKeyUsage=emailProtection,clientAuth \n");
+ fclose($fd);
+
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title><?=gentitle("System: Advanced functions");?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link href="gui.css" rel="stylesheet" type="text/css">
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<form action="system_advanced_create_certs.php" method="post" name="iform" id="iform">
+<?php include("fbegin.inc"); ?>
+ <p class="pgtitle">System: Advanced functions - Create Certificates</p>
+ <?php if ($input_errors) print_input_errors($input_errors); ?>
+ <?php if ($savemsg) print_info_box($savemsg); ?>
+ <p>One moment please...
+ <?php
+ mwexec("cd /tmp/ && /usr/bin/openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650 -config /etc/ssl/openssl.cnf -passin pass:test -nodes");
+ $fd = fopen("/tmp/cacert.pem", "r");
+ $cacert = fread($fd,8096);
+ fclose($fd);
+ $fd = fopen("/tmp/cakey.pem", "r");
+ $cakey = fread($fd,8096);
+ fclose($fd);
+ $cacertA = ereg_replace("\r","",$cacert);
+ $cakeyA = ereg_replace("\r","",$cakey);
+ $cacert = ereg_replace("\n","\\n",$cacert);
+ $cakey = ereg_replace("\n","\\n",$cakey);
+ ?>
+ <script language="JavaScript">
+ <!--
+ var cacert='<?=$cacert?>';
+ var cakey='<?=$cakey?>';
+ opener.document.forms[0].cert.value=cacert;
+ opener.document.forms[0].key.value=cakey;
+ this.close();
+ -->
+ </script>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
+
+<?php
+
+} else {
+
+?>
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+ <html>
+ <head>
+ <title><?=gentitle("System: Advanced functions");?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link href="gui.css" rel="stylesheet" type="text/css">
+ <body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+ <form action="system_advanced_create_certs.php" method="post" name="iform" id="iform">
+ <?php include("fbegin.inc"); ?>
+ <p class="pgtitle">System: Advanced functions - Create Certificates</p>
+
+ <table>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Country Code (2 Letters)</td>
+ <td width="78%" class="vtable">
+ <input name="countrycode" value="<?=$countrycode?>">
+ </span></td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">State or Province name</td>
+ <td width="78%" class="vtable">
+ <input name="stateorprovince" value="<?=$stateorprovince?>">
+ </span></td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">City name</td>
+ <td width="78%" class="vtable">
+ <input name="cityname" value="<?=$cityname?>">
+ </span></td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">Organization name</td>
+ <td width="78%" class="vtable">
+ <input name="orginizationname" value="<?=$orginizationname?>">
+ </span></td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">Organization department</td>
+ <td width="78%" class="vtable">
+ <input name="orginizationdepartment" value="<?=$orginizationdepartment?>">
+ </span></td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">Common Name (Your name)</td>
+ <td width="78%" class="vtable">
+ <input name="commonname" value="<?=$commonname?>">
+ </span></td>
+ </tr>
+
+ <!--
+ <tr>
+ <td width="22%" valign="top" class="vncell">E-Mail address</td>
+ <td width="78%" class="vtable">
+ <input name="email" value="<?=$email?>">
+ </span></td>
+ </tr>
+ -->
+
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ </td>
+ </tr>
+
+ <?php include("fend.inc"); ?>
+ </body>
+ </html>
+
+<?php
+}
+?>
OpenPOWER on IntegriCloud