-
Notifications
You must be signed in to change notification settings - Fork 35
SSL handshake failures are not caught #67
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
Comments
I fixed this for my example program by simply replacing |
Ya, don't do |
@tannewt what's the issue with catching everything here? Is there an exception that's considered acceptable? All the step does is mark that the socket is not ready to receive data and close it, which seems like the right thing to do for any exception. |
Alternatively I could add in an |
Catching everything is bad because you'll catch extra stuff. Reload, keyboard and deep sleep all use exceptions. Those things (or others) may be caught higher and the code will expect the socket to continue. So, always be explicit with catching exceptions. |
Closed by #70 |
In the request method, while attempting to send a request, only
_SendFailed
exceptions are caught and all others (such as aFailed SSL handshake
, which may occur after too much time has elapsed between requests) are ignored. This then leads torecv
orrecv_into
being run on an invalid connection, resulting in an exception and potentially a socket leak.This was discovered while debugging adafruit/circuitpython#4061, but does not wholly fix the issue as the code will then run into issue #66. May be related to #63.
The text was updated successfully, but these errors were encountered: