aliases = ['test1.example.com', 'test2.example.com']
if aliases:
    subject_alt_names = []
for alias in aliases:
    subject_alt_names.append('DNS:{}'.format(alias))
req.add_extensions([crypto.X509Extension('subjectAltName', False, ','.join(
    subject_alt_names))])
Создание CSR с помощью Python (крипто)