[Twisted-Python] getpeername from verify callback

Adi Roiban adi at roiban.ro
Fri Oct 19 02:36:49 EDT 2012

On 19 October 2012 07:41, Nathan Mower <nathanm at securitymetrics.com> wrote:
> The following sample code worked until Twisted began to prefer memory BIOs over socket BIOs.  Now it produces this error...
> exceptions.AttributeError: 'NoneType' object has no attribute 'getpeername'
> ...on line 9 where getpeername() is called by the verify() callback.
> Is there any way to obtain the peer name, given the OpenSSL.SSL.Connection object passed into verify()?  Anything that surfaces the underlying socket?  (Perhaps something similar to what is done in connectionMade(), which does work.)  Or alternatively, is there a way to tell the reactor to employ socket BIOs?


I think that we are talking about this bug:


Adi Roiban

More information about the Twisted-Python mailing list