'Extract subjectAltName DNS name settings from certificate extensions
@param peer_cert: peer certificate in SSL connection.  subjectAltName
settings if any will be extracted from this
@type peer_cert: OpenSSL.crypto.X509'

@classmethod
def _get_subj_alt_name(cls, peer_cert):

    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 == cls.SUBJ_ALT_NAME_EXT_NAME):
            ext_dat = ext.get_data()
            decoded_dat = der_decoder.decode(ext_dat, asn1Spec=general_names)
            for name in decoded_dat:
                if isinstance(name, SubjectAltName):
                    for entry in range(len(name)):
                        component = name.getComponentByPosition(entry)
                        dns_name.append(str(component.getComponent()))
    return dns_name
