From 762af5dd48de7540f36823820ba76ebd91157fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:44:28 +0000 Subject: [PATCH] issue: server DN default value evaluation time --- api/kiwi_vpn_api/easyrsa.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/kiwi_vpn_api/easyrsa.py b/api/kiwi_vpn_api/easyrsa.py index 3f464c2..0b79386 100644 --- a/api/kiwi_vpn_api/easyrsa.py +++ b/api/kiwi_vpn_api/easyrsa.py @@ -252,12 +252,15 @@ class EasyRSA: def issue( self, cert_type: CertificateType = CertificateType.client, - dn: DistinguishedName = DistinguishedName.build(), + dn: DistinguishedName | None = None, ) -> crypto.X509 | None: """ Issue a client or server certificate """ + if dn is None: + dn = DistinguishedName.build() + if not (cert_type is CertificateType.client or cert_type is CertificateType.server): return None