summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-24 10:20:39 +0200
committerGitHub <noreply@github.com>2024-04-24 10:20:39 +0200
commita63e934073744772dc9fd919b7bb376ed9ceeab3 (patch)
treea6acb95013c327ad44ad856ce0b27264528b7209 /python
parent5b3f2b5708d18f14b4ff24b37119947258ea4e78 (diff)
parenta849d913dc6a86c698dc215350a46b7af72bb99e (diff)
downloadvyos-1x-a63e934073744772dc9fd919b7bb376ed9ceeab3.tar.gz
vyos-1x-a63e934073744772dc9fd919b7bb376ed9ceeab3.zip
Merge pull request #3345 from Embezzle/T6259
PKI: T6259: Support RFC822 names in certificate generation
Diffstat (limited to 'python')
-rw-r--r--python/vyos/pki.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/pki.py b/python/vyos/pki.py
index 3c577db4d..27fe793a8 100644
--- a/python/vyos/pki.py
+++ b/python/vyos/pki.py
@@ -146,7 +146,7 @@ def create_certificate_request(subject, private_key, subject_alt_names=[]):
if isinstance(obj, ipaddress.IPv4Address) or isinstance(obj, ipaddress.IPv6Address):
alt_names.append(x509.IPAddress(obj))
elif isinstance(obj, str):
- alt_names.append(x509.DNSName(obj))
+ alt_names.append(x509.RFC822Name(obj) if '@' in obj else x509.DNSName(obj))
if alt_names:
builder = builder.add_extension(x509.SubjectAlternativeName(alt_names), critical=False)