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

🥅 Re-raise #starttls error from receiver thread #395

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Feb 3, 2025

Fixes #394.

When start_tls_session raises an exception, that's caught in the receiver thread, but not re-raised. Fortunately, @sock will now be a permanently broken SSLSocket, so I don't think this can lead to accidentally using an insecure connection.

Even so, #starttls should disconnect the socket and re-raise the error immediately.

Failing test case was provided by @rhenium in #394.

Fixes #394.

When `start_tls_session` raises an exception, that's caught in the
receiver thread, but not re-raised.  Fortunately, `@sock` will now be
a permanently broken SSLSocket, so I don't think this can lead to
accidentally using an insecure connection.

Even so, `#starttls` should disconnect the socket and re-raise the error
immediately.

Failing test case was provided by @rhenium in #394.

Co-authored-by: Kazuki Yamaguchi <[email protected]>
@nevans nevans requested a review from rhenium February 4, 2025 00:03
@nevans nevans merged commit 257ede0 into master Feb 4, 2025
37 checks passed
@nevans nevans deleted the fix-starttls-swallowed-exception branch February 4, 2025 15:11
@nevans nevans added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

Net::IMAP#starttls doesn't raise an exception when it fails
1 participant