-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select() support - tlsrecordlayer fileno() is not supported, required when integrating with hyper http2 client #414
Comments
|
you can try extracting the fileno of the wrapped socket ( |
@tomato42 is this right, so read only blocks until bytes are received via the socket so if select.select is called on self.sock.fileno before any bytes have been received then this might work ? |
more or less, what I'm referring to is that inside tlslite-ng are 2 levels of buffering, one on record level and another on handshake/alert message processing level; if they are not cleared first (and by clear I mean "no data can be extracted from them", not "empty"; e.g. record layer buffering returns only full records to layers above in stack) then select() will block even if a read from the TLSConnection wouldn't block |
that doesn't sound ideal, i would imagine this would also be a problem if we tried to integrate it to some other http clients that don't expect such a big abstraction layer that tls lite has. |
@tomato42 Could you please contact me via email [email protected] , I would like to get in touch for a quick chat if you don't mind. |
this isn't something I need tlslite-ng for so I won't work on this, at most I can offer reviewing pull requests |
I have integrated TLSLite to asyncio and had no issues, you need to implement an async driver for tlslite, pass to it a non blocking socket and handle the "want read" and "want write" signals from its generator coroutines. |
@HMaker any chance you could share an example of how you did that? I would like to use tlslite-ng with grpclib (https://github.com/vmagamedov/grpclib). |
Hi,
When integrating tlslite to work with hyper http2 client we ran into an exception when sending a request.
socket.can_read calls select.select() which needs fileno ,but it's not supported according to https://github.com/tomato42/tlslite-ng/blob/09f55888603c847a0ff68f82b69f29d48c78da69/tlslite/tlsrecordlayer.py#L654 .
If can_read is removed from hyper, then a successful request can be made ,but likely to be unstable and hang sometimes according to the developer of hyper.
Fileno might not be required ,but some kind of way to check 'can_read' is needed for this to work.
Any help would be greatly appreciated
The text was updated successfully, but these errors were encountered: