Skip to content
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

Issue when setting socket timeout for HTTPS #16908

Open
3 tasks
andresriancho opened this issue Apr 13, 2018 · 0 comments
Open
3 tasks

Issue when setting socket timeout for HTTPS #16908

andresriancho opened this issue Apr 13, 2018 · 0 comments
Assignees

Comments

@andresriancho
Copy link
Owner

andresriancho commented Apr 13, 2018

When w3af tries to set a timeout for a SSL socket, a WantRead exception is raised by OpenSSL, the root issue is in OpenSSL code: pyca/pyopenssl#168

But it affects me, since I can't set a timeout for HTTPS connections:
bc1ecf2

This sucks since it means that while an HTTPS connection is alive in the keep alive connection pool, its timeout will remain the same. This leads to some issues, since:

  • extended_urllib.py sets different timeouts based on errors and responses, which will be ignored because an old HTTPS connection, with an old timeout setting will be reused.
  • The plugins might set specific timeouts for their requests, which will also be ignored.

I need to try to fix this issue at it's root, but the workaround explained in pyca/pyopenssl#168 seems complex to get right.

Something that might work is to modify the code that chooses a connection from the connection pool. If there is a free connection with a timeout similar (or the equals?) to the one specified in the request, then choose that connection, otherwise create a new one.

The bad thing about this connection selection process is that the keep alive handler will be less effective: more connections are going to be created, each connection will send / receive less traffic.

TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant