acme: allow wildcards as domain

allow wildcard dns-names as defined in [0,1] (only the prefix '*.' in
front of a valid dns-name) as domain.

[0] https://tools.ietf.org/html/rfc8555#section-7.1.3
[1] https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2021-04-15 21:46:21 +02:00 committed by Thomas Lamprecht
parent a4fc99f7ab
commit 66c5ceb848
3 changed files with 7 additions and 1 deletions

View File

@ -126,6 +126,11 @@ Ext.apply(Ext.form.field.VTypes, {
},
DnsNameText: gettext('This is not a valid DNS name'),
DnsNameOrWildcard: function(v) {
return Proxmox.Utils.DnsName_or_Wildcard_match.test(v);
},
DnsNameOrWildcardText: gettext('This is not a valid DNS name'),
// workaround for https://www.sencha.com/forum/showthread.php?302150
proxmoxMail: function(v) {
return (/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,63}$/).test(v);

View File

@ -1213,6 +1213,7 @@ utilities: {
let DnsName_REGEXP = "(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]*[a-zA-Z0-9])?)\\.)*(?:[A-Za-z0-9](?:[A-Za-z0-9\\-]*[A-Za-z0-9])?))";
me.DnsName_match = new RegExp("^" + DnsName_REGEXP + "$");
me.DnsName_or_Wildcard_match = new RegExp("^(?:\\*\\.)?" + DnsName_REGEXP + "$");
me.HostPort_match = new RegExp("^(" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")(?::(\\d+))?$");
me.HostPortBrackets_match = new RegExp("^\\[(" + IPV6_REGEXP + "|" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")\\](?::(\\d+))?$");

View File

@ -153,7 +153,7 @@ Ext.define('Proxmox.window.ACMEDomainEdit', {
xtype: 'proxmoxtextfield',
name: 'domain',
allowBlank: false,
vtype: 'DnsName',
vtype: 'DnsNameOrWildcard',
value: '',
fieldLabel: gettext('Domain'),
},