Skip to content

Make NUT OpenSSL dialogs more reliable#3351

Merged
jimklimov merged 2 commits intonetworkupstools:masterfrom
jimklimov:nit-ssl
Mar 20, 2026
Merged

Make NUT OpenSSL dialogs more reliable#3351
jimklimov merged 2 commits intonetworkupstools:masterfrom
jimklimov:nit-ssl

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Mar 16, 2026

Follow-up to #3344, this PR applies similar logic of retrying (in case of SSL_ERROR_WANT_WRITE or SSL_ERROR_WANT_READ return codes) to read and write commands during the normal protocol dialog, not just during handshake.

Without this, make check-NIT failed on Windows at least with OpenSSL builds - upsc established the connection but failed actual queries (possibly it broke at the moment of sending/reading the "OK STARTTLS" confirmation). Apparently it fared better on all other NUT CI farm systems, regardless of their performance (some builders are co-located on quite congested hosts).

CC @clepple : this picks up the trick from your ssl_accept_nbio branch, of return 0 from ssl_error() methods in case of these retryable return codes. The rest of non-blockable support (is it needed or not, toxic or not, after progress made in recent PRs) remains questionable to me. For some clarity, I'll bump the ssl_accept_nbio_v285 branch after merging this PR (if it passes) to see how it fares in CI.

Also FYI CC @aquette - with this, SSL support should be at least functional on various platforms. Previously much of it happened to work if conditions were just right, and crashed elsewhere. Converging OpenSSL and NSS code to behave similarly, so it is a preference and not a choice driven by technical constraints, is a separate matter (#3331).

@jimklimov jimklimov added this to the 2.8.5 milestone Mar 16, 2026
@jimklimov jimklimov added bug Windows SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters portability We want NUT to build and run everywhere possible labels Mar 16, 2026
…fall back from symlink to hardlink to copy [networkupstools#1711]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot
Copy link

@jimklimov jimklimov merged commit c6fc9b2 into networkupstools:master Mar 20, 2026
22 of 23 checks passed
@jimklimov jimklimov deleted the nit-ssl branch March 20, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug portability We want NUT to build and run everywhere possible SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants