alekstorm / backports.ssl

UNMAINTAINED - The Python 3.4 standard `ssl` module API implemented on top of pyOpenSSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_subject_alt_name fails to find subjectAltName data under Python 3

mjs opened this issue · comments

Under Python 3, extension names come back as bytes but get_subject_alt_name compares the name to a unicode string so the comparison fails.

I noticed the problem when connecting to imap.mail.yahoo.com. The commonName has *.imap.mail.yahoo.com which doesn't match the hostname and one of the subjectAltName entries is imap.mail.yahoo.com so that is the entry that's required. Under Python 3, the hostname check fails but it works under Python 2.

This should be easy enough to fix but I don't have time right now so I'm just filing the bug for now.

Looks like this has been fixed in 0a151fa and 5aa4cb0.