def cert_get_domains(cert):
 domains = []
 try:
  ext = cert.extensions.get_extension_for_oid(x509.OID_SUBJECT_ALTERNATIVE_NAME)
  entries = ext.value.get_values_for_type(x509.DNSName)
  for entry in entries:
   domains.append(entry)
 except Exception as e:
  app.logger.warning('Failed to get SubjectAltName: {0}'.format(e))
 return domains

def cert_get_domains ( cert ) : domains = [ ] try : ext = cert . extensions . get_extension_for_oid ( x509 . OID_SUBJECT_ALTERNATIVE_NAME ) entries = ext . value . get_values_for_type ( x509 . DNSName ) for entry in entries : domains . append ( entry ) except Exception as e : app . logger . warning ( 'Failed to get SubjectAltName: {0}' . format ( e ) ) return domains
attempts to get an domains listed in a certificate .