for alias in aliases:
    subject_alt_names.append('DNS:{}'.format(alias))
req.add_extensions([crypto.X509Extension('subjectAltName', False, ','.join(
    subject_alt_names))])
Generating a CSR with Python (crypto)