Opened 2 years ago

Last modified 2 years ago

#5851 defect new

t.i.ssl.Certificate __repr__ assumes certificate will have a common name.

Reported by: mmcc Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description (last modified by exarkun)

It raises AttributeError when a cert has no common name.

>>> from twisted.internet import ssl
>>>pemfn = 'UbuntuOne-Go_Daddy_CA.pem'
>>> pemd = open(pemfn, 'r').read()
>>> ssl.Certificate.loadPEM(pemd)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "Twisted-11.1.0-py2.7-macosx-10.7-x86_64.egg/twisted/internet/_sslverify.py", line 166, in __repr__
    self.getIssuer().commonName)
  File "Twisted-11.1.0-py2.7-macosx-10.7-x86_64.egg/twisted/internet/_sslverify.py", line 85, in __getattr__
    raise AttributeError(attr)
AttributeError: commonName
>>> 

Change History (1)

comment:1 Changed 2 years ago by exarkun

  • Description modified (diff)
Note: See TracTickets for help on using tickets.