Skip to content

Conversation

@Guest0x0
Copy link
Collaborator

@Guest0x0 Guest0x0 commented Nov 4, 2025

OpenSSL's SSL_read/SSL_write does not seem to handle zero return from the underlying BIO correctly. It keeps reporting SSL_WANT_READ in this case, instead of SSL_ZERO_RETURN or others. So if the peer closed the underlying connection unexpectedly when @tls.Tls is attempting a read (e.g. in connect or read), current implementation falls into infinite loop. This PR fixes the issue and handle peer connection close properly.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 713

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 78.011%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/tls/tls.mbt 1 2 50.0%
Totals Coverage Status
Change from base Build 712: 0.09%
Covered Lines: 1224
Relevant Lines: 1569

💛 - Coveralls

@Guest0x0 Guest0x0 merged commit 167ba9e into main Nov 4, 2025
10 checks passed
@Guest0x0 Guest0x0 deleted the fix-tls branch November 4, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants