Title: Fix SSL handshake over-reading in STARTTLS by youknowone · Pull Request #7417 · RustPython/RustPython · GitHub
Open Graph Title: Fix SSL handshake over-reading in STARTTLS by youknowone · Pull Request #7417 · RustPython/RustPython
X Title: Fix SSL handshake over-reading in STARTTLS by youknowone · Pull Request #7417 · RustPython/RustPython
Description: During STARTTLS handshake, sock_recv(16KB) could consume application data that arrived alongside handshake records. The consumed data ended up in rustls's internal buffer where select() could not detect it, causing asyncore-based servers to miss readable events and the peer to time out. Use MSG_PEEK to find the TLS record boundary, then recv() only one complete record. Remaining data stays in the kernel TCP buffer, visible to select(). This matches OpenSSL's default no-read-ahead behaviour. Fixes flaky test_poplib (TestPOP3_TLSClass) failures. Summary by CodeRabbit Bug Fixes Enhanced TLS handshake record processing to correctly handle TLS record boundaries, preventing premature buffer draining and potential loss of application data in socket-based connections. Improved timeout error reporting consistency across SSL, socket, and system API operations.
Open Graph Description: During STARTTLS handshake, sock_recv(16KB) could consume application data that arrived alongside handshake records. The consumed data ended up in rustls's internal buffer where select() could n...
X Description: During STARTTLS handshake, sock_recv(16KB) could consume application data that arrived alongside handshake records. The consumed data ended up in rustls's internal buffer where select() cou...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7417
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5fc61627-20fe-5ddd-34fd-a02914228e3c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E144:25FADE:CB4AC:11021E:6A5ECEDC |
| html-safe-nonce | 6d24dbc33e211e50371519b07e3be5305939dd039701b29f59c491b0934bc884 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTQ0OjI1RkFERTpDQjRBQzoxMTAyMUU6NkE1RUNFREMiLCJ2aXNpdG9yX2lkIjoiNzQ0MjM0NzE1NTA5MTU0MTcyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 386d00eafe39586aeec0874e4a6c9cf99c99b9f5891c6b27c79572475df78376 |
| hovercard-subject-tag | pull_request:3392626672 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7417/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | During STARTTLS handshake, sock_recv(16KB) could consume application data that arrived alongside handshake records. The consumed data ended up in rustls's internal buffer where select() could n... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9bd00899c80f8b6ea4e7a96c99290af4722b0befdf9e021b19232cbd6f993660 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9996307881fdf9017d864a20b3dfe5aae4dddd3e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width