Allow whitespaces in domain ACL regex

In some cases there are extraneous spaces in the configuration file for visual aid (or simply accidental) preventing the domains from being picked up. Also adding `req.ssl_sni` as a valid criterion for non-http TLS traffic.
This commit is contained in:
Istvan Pusztai 2017-08-25 20:38:47 -04:00 committed by GitHub
parent 9511e4c1b5
commit d2d006c2a7
1 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ from certbot import errors
from certbot_haproxy.util import MemoiseNoArgs
RE_HAPROXY_DOMAIN_ACL = re.compile(
r'\s*acl (?P<name>[0-9a-z_\-.]+) '
r'hdr\(host\) -i '
r'\s*acl\s+(?P<name>[0-9a-z_\-.]+)\s+'
r'(?:hdr\(host\)|req\.ssl_sni)\s+-i\s+'
r'(?P<domain>' # Start group "domain"
r'(?:[0-9-a-z](?:[a-z0-9-]{0,61}[a-z0-9]\.)+)' # (sub-)domain parts
r'(?:[0-9-a-z](?:[a-z0-9-]{0,61}[a-z0-9]))' # TLD part