mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
crtmgr: fix bug if CERTMONGER_CERTIFICATE not set
If CERTMONGER_CERTIFICATE is not set in certain scenario, the code would fail since None cannot be passed to loading certificates. https://pagure.io/freeipa/issue/4985 Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
parent
0412625a2b
commit
a3c11b01af
@ -379,10 +379,10 @@ def retrieve_or_reuse_cert(**kwargs):
|
||||
if not nickname:
|
||||
return (REJECTED, "Nickname could not be determined")
|
||||
|
||||
cert = x509.load_pem_x509_certificate(
|
||||
fix_pem(os.environ.get('CERTMONGER_CERTIFICATE'))) # TODO: the fix_pem somehow got there early, so making this comment way too long to get rid of it later
|
||||
cert = os.environ.get('CERTMONGER_CERTIFICATE')
|
||||
if not cert:
|
||||
return (REJECTED, "New certificate requests not supported")
|
||||
cert = x509.load_pem_x509_certificate(fix_pem(cert.encode('ascii')))
|
||||
|
||||
with ldap_connect() as conn:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user