

def get_subj_alt_name(peer_cert):
    dns_name = []
    if (not SUBJ_ALT_NAME_SUPPORT):
        return dns_name
    general_names = SubjectAltName()
    for i in range(peer_cert.get_extension_count()):
        ext = peer_cert.get_extension(i)
        ext_name = ext.get_short_name()
        if (ext_name != 'subjectAltName'):
            continue
        ext_dat = ext.get_data()
        decoded_dat = der_decoder.decode(ext_dat, asn1Spec=general_names)
        for name in decoded_dat:
            if (not isinstance(name, SubjectAltName)):
                continue
            for entry in range(len(name)):
                component = name.getComponentByPosition(entry)
                if (component.getName() != 'dNSName'):
                    continue
                dns_name.append(str(component.getComponent()))
    return peer_cert

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/contrib/pyopenssl.py get_subj_alt_name/VarMisuse@176/251 `dns_name`->`peer_cert`