Skip to content

Conversation

darkrain42
Copy link
Contributor

Fix the error handling in Connection.shutdown so that underlying socket conditions (SSL_ERR_WANT_WRITE, SSL_ERR_WANT_WRITE, or other system-level errors such as ECONNRESET) are propagated properly.

This fixes #91.

On error (return < 0), the OpenSSL documentation says to call SSL_get_error to
discover the cause, as the act of trying to shutdown may raise lower-level
errors (e.g. socket errors), or return SSL_ERR_WANT_WRITE or
SSL_ERR_WANT_READ.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling bff1d1a on darkrain42:Connection.shutdown-errors into 7b31baf on pyca:master.

@exarkun
Copy link
Member

exarkun commented Jan 8, 2015

Thanks. Do you want to add a ChangeLog entry for this fix as well?

@darkrain42
Copy link
Contributor Author

Done!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 306b75a on darkrain42:Connection.shutdown-errors into 7b31baf on pyca:master.

exarkun pushed a commit that referenced this pull request Jan 13, 2015
Fix error handling in Connection.shutdown.
@exarkun exarkun merged commit 014c0cc into pyca:master Jan 13, 2015
@darkrain42 darkrain42 deleted the Connection.shutdown-errors branch May 16, 2015 22:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

SSL_shutdown error codes are un-discoverable

3 participants