Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
charhate committed Jul 12, 2023
1 parent a8fc5cc commit 5577191
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lemur/plugins/lemur_aws/elb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.. moduleauthor:: Kevin Glisson <[email protected]>
"""
import botocore
import click
from flask import current_app

from retrying import retry
Expand Down Expand Up @@ -429,7 +428,7 @@ def attach_certificate_v2(listener_arn, port, certificates, **kwargs):
)

if needs_cert_update_for_sni:
click.echo("[+] Adding cert as listener cert for SNI")
current_app.logger.info(f"Adding cert as listener cert for SNI. listener_arn: {listener_arn}")
kwargs["client"].add_listener_certificates(
ListenerArn=listener_arn, Certificates=certificates
)
Expand Down Expand Up @@ -457,15 +456,15 @@ def has_listener_cert_for_sni(listener_arn, client):
default_cert = ""

for cert in listener_certificates["Certificates"]:
if cert["IsDefault"]:
if "IsDefault" in cert and cert["IsDefault"]:
default_cert = cert["CertificateArn"]
break

if not default_cert:
return False

for cert in listener_certificates["Certificates"]:
if cert["IsDefault"] is False and cert["CertificateArn"] == default_cert:
if "IsDefault" in cert and cert["IsDefault"] is False and cert["CertificateArn"] == default_cert:
return True

return False
Expand Down

0 comments on commit 5577191

Please sign in to comment.