Skip to content

Commit be0a1bb

Browse files
committed
Make email field optional
As email address isn't a required field for self generated certificates.
1 parent bb76f91 commit be0a1bb

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

bin/v-generate-ssl-cert

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ cd $workdir
9393
# Generate private key
9494
openssl genrsa $KEY_SIZE > $domain.key 2>/dev/null
9595

96+
subj=""
9697
# Generate the CSR
97-
subj="/emailAddress=$email/C=$country/ST=$state/L=$city/O=$org"
98+
if [ -z "$email" ]; then
99+
subj="/emailAddress=$email"
100+
fi
101+
102+
subj="$subj/C=$country/ST=$state/L=$city/O=$org"
98103
subj="$subj/OU=$org_unit/CN=$domain_idn"
99104

100105
if [ -z "$aliases" ]; then

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
11811181

11821182
# Generating SSL certificate
11831183
echo "[ * ] Generating default self-signed SSL certificate..."
1184-
$HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
1184+
$HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'US' 'California' \
11851185
'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
11861186

11871187
# Parsing certificate file

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
12101210

12111211
# Generating SSL certificate
12121212
echo "[ * ] Generating default self-signed SSL certificate..."
1213-
$HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
1213+
$HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'US' 'California' \
12141214
'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
12151215

12161216
# Parsing certificate file

web/generate/ssl/index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
} else {
1212
$v_domain = 'example.ltd';
1313
}
14-
$v_email = 'admin@' . $v_domain;
14+
$v_email = '';
1515
$v_country = 'US';
1616
$v_state = 'California';
1717
$v_locality = 'San Francisco';
@@ -39,7 +39,6 @@
3939
if (empty($_POST['v_state'])) $errors[] = _('State');
4040
if (empty($_POST['v_locality'])) $errors[] = _('City');
4141
if (empty($_POST['v_org'])) $errors[] = _('Organization');
42-
if (empty($_POST['v_email'])) $errors[] = _('Email');
4342
$v_domain = $_POST['v_domain'];
4443
$v_aliases = $_POST['v_aliases'];
4544
$v_email = $_POST['v_email'];

web/templates/admin/generate_ssl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</tr>
6868
<tr>
6969
<td class="vst-text" style="padding: 12px 0 0 0;">
70-
<?php print _('Email');?>
70+
<?php print _('Email');?> <span class="optional">(<?php print _('optional');?>)</span>
7171
</td>
7272
</tr>
7373
<tr>

0 commit comments

Comments
 (0)