mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Solved wildcard redirect bug
This commit is contained in:
@@ -37,3 +37,15 @@ class CertUtils:
|
||||
if 'cert.pem' in files:
|
||||
cert_files.append(os.path.join(root, 'cert.pem'))
|
||||
return cert_files
|
||||
|
||||
@staticmethod
|
||||
def matches(domain, san):
|
||||
"""Check if the SAN entry matches the domain according to wildcard rules."""
|
||||
if san.startswith('*.'):
|
||||
base = san[2:]
|
||||
# Check if domain is direct subdomain (one label only)
|
||||
if domain.count('.') == base.count('.') + 1 and domain.endswith('.' + base):
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
return domain == san
|
||||
|
Reference in New Issue
Block a user