[Cryptography-dev] pyOpenSSL: non-blocking socket support

Nikolaus Rath Nikolaus at rath.org
Tue Jun 28 12:24:54 EDT 2016


On Jun 28 2016, Vladimir Didenko <vladimir.didenko-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> 2016-06-28 2:07 GMT+03:00 Nikolaus Rath <Nikolaus-BTH8mxji4b0 at public.gmane.org>:
>
>> Hello,
>>
>> IIAC, when using the standard library's ssl module, the following can
>> happen (distilled from http://bugs.python.org/issue22499):
>>
>
> I read this issue and it looks like I misunderstood you question.
>
>
>> If I understand correctly, this is because the ssl module does not
>> actually implement the 'struct iostate' state machinery required by
>> OpenSSL and instead just blindly raises SSLWantRead/SSLWantWrite.
>
> And it shouldn't implement it. It is task for user to handle IO state.

Is there a reason not to implement it in the pyOpenSSL layer, though?

>> Can someone tell me how pyOpenSSL supports non-blocking socket? Does it
>> also require the caller to maintain struct iostate, or does it allow to
>> work with just SSLWantRead/Write and select()?
>
> Doesn't differ from standard ssl module.
>
> Resume: you can use nonblocking ssl socket with standard ssl module and
> PyOpenSSL. Though it requires some work from you (but it is not hard!).

I don't understand why everyone using it would have to re-implement the
same functionality. Would you be interested in a patch that adds this to
pyOpenSSL?

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Cryptography-dev mailing list