[issue37079] PEM cadata causes ssl.SSLError: nested asn1 error

2019-05-28 Thread Jizhou Yang
New submission from Jizhou Yang : Loading cadata in PEM format results in a nested asn1 error. Workaround is to convert cadata to unicode. Minimum code for reproducing the issue: >>>import ssl >>> with open('ca.crt') as f: ... ca_crt = f.read() ... >>> c = ssl.create_default_context() >>>

[issue37079] PEM cadata causes ssl.SSLError: nested asn1 error

2019-05-28 Thread Christian Heimes
Christian Heimes added the comment: The documentation refers to ASCII string as Python 3-style ASCII text object. In Python 2, that's the unicode data type. The feature was backported from Python 3. I guess the documentation was directly taken from Python 3's documentation and not updated to

[issue37079] PEM cadata causes ssl.SSLError: nested asn1 error

2019-05-28 Thread Jizhou Yang
Jizhou Yang added the comment: Thanks a lot for the quick answer! Verified that the proposed solution works with PEM certificates in both Python 2 and 3. -- stage: -> resolved status: pending -> closed ___ Python tracker