Identify SSL support in upsd and libupsclient, add NIT tests for OpenSSL and Mozilla NSS#3330
Merged
jimklimov merged 46 commits intonetworkupstools:masterfrom Mar 7, 2026
Merged
Conversation
Member
Author
|
Member
Author
|
|
❌ Build nut 2.8.4.4263-master failed (commit 8f68fa9f9c by @jimklimov) |
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 26, 2026
…etworkupstools#3330, networkupstools#3329] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 26, 2026
…to handle numeric or specific string values, to match both ways of reading ambiguous documentation [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 27, 2026
…etworkupstools#3330, networkupstools#3329] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 27, 2026
…to handle numeric or specific string values, to match both ways of reading ambiguous documentation [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…etworkupstools#3330, networkupstools#3329] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…to handle numeric or specific string values, to match both ways of reading ambiguous documentation [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…ver we change nut_debug_level [networkupstools#1711, networkupstools#2800, networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…ibupsclient consumers to use upscli_set_debug_level() where available [networkupstools#1711, networkupstools#2800, networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…ver we change nut_debug_level [networkupstools#1711, networkupstools#2800, networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Feb 28, 2026
…ibupsclient consumers to use upscli_set_debug_level() where available [networkupstools#1711, networkupstools#2800, networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.4.4267-master completed (commit 47c3b5dc77 by @jimklimov) |
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 1, 2026
…etworkupstools#3330, networkupstools#3329] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 1, 2026
…to handle numeric or specific string values, to match both ways of reading ambiguous documentation [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 1, 2026
…ver we change nut_debug_level [networkupstools#1711, networkupstools#2800, networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ools#1711] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…workupstools#1711] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…on actual code may be needed to rectify it after all [networkupstools#3331, networkupstools#1711] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.4.4291-master completed (commit 5b73154058 by @jimklimov) |
|
❌ Build nut 2.8.4.4295-master failed (commit 742f47e8c3 by @jimklimov) |
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 5, 2026
…file libupsclient.la exists and is not empty [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.4.4297-master completed (commit 514336e560 by @jimklimov) |
…upstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…file libupsclient.la exists and is not empty [networkupstools#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…on.h [networkupstools#3328] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 8, 2026
…ng sockets [networkupstools#3331] The TLS handshake functions `SSL_accept()` (server) and `SSL_connect()` (client) require a retry loop when the underlying socket is in non-blocking mode. When either function returns '-1' with an error code of `SSL_ERROR_WANT_READ` or `SSL_ERROR_WANT_WRITE`, it is signalling a non-fatal "not done yet" condition: the handshake needs more I/O turns to complete. The correct response is to wait for the socket fd to become ready in the indicated direction and then call the same function again with the same SSL object (this is explicitly documented in OpenSSL for every version since 0.9.x and the API contract has never changed). Previously both call sites used a single-shot switch/case pattern that treated these non-fatal WANT_READ/WANT_WRITE returns as fatal errors, tearing down the connection immediately. On Linux the loopback socket is fast enough that the handshake *nearly always* completes in the first call, masking the bug. On BSD (FreeBSD, OpenBSD, NetBSD), macOS, and illumos-based systems (OmniOS, OpenIndiana) the loopback socket behaves differently and WANT_READ/WANT_WRITE are returned regularly, causing CI failures on all of those platforms regardless of compiler, C standard dialect, or OpenSSL version used. The fix is identical for all supported OpenSSL versions (0.9.x / 1.0.x / 1.1.x / 3.x): the `SSL_ERROR_WANT_*` codes and the required retry semantics have been stable since the library's inception. No NSS changes are needed: NSS uses `SSL_ForceHandshake()` which is already blocking-by-design through NSPR. Fixes issues (re-)discovered and/or confirmed by work on PR networkupstools#3330 for issue networkupstools#1711 Tested-on: Linux (passes), macOS 12, FreeBSD 12, NetBSD 11, OpenBSD 6.5, OmniOS (amd64+i386), OpenIndiana (amd64+i386) - all compilers and C standard dialects in the CI matrix. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 8, 2026
…ng sockets [networkupstools#3331] The TLS handshake functions `SSL_accept()` (server) and `SSL_connect()` (client) require a retry loop when the underlying socket is in non-blocking mode. When either function returns '-1' with an error code of `SSL_ERROR_WANT_READ` or `SSL_ERROR_WANT_WRITE`, it is signalling a non-fatal "not done yet" condition: the handshake needs more I/O turns to complete. The correct response is to wait for the socket fd to become ready in the indicated direction and then call the same function again with the same SSL object (this is explicitly documented in OpenSSL for every version since 0.9.x and the API contract has never changed). Previously both call sites used a single-shot switch/case pattern that treated these non-fatal WANT_READ/WANT_WRITE returns as fatal errors, tearing down the connection immediately. On Linux the loopback socket is fast enough that the handshake *nearly always* completes in the first call, masking the bug. On BSD (FreeBSD, OpenBSD, NetBSD), macOS, and illumos-based systems (OmniOS, OpenIndiana) the loopback socket behaves differently and WANT_READ/WANT_WRITE are returned regularly, causing CI failures on all of those platforms regardless of compiler, C standard dialect, or OpenSSL version used. The fix is identical for all supported OpenSSL versions (0.9.x / 1.0.x / 1.1.x / 3.x): the `SSL_ERROR_WANT_*` codes and the required retry semantics have been stable since the library's inception. No NSS changes are needed: NSS uses `SSL_ForceHandshake()` which is already blocking-by-design through NSPR. Fixes issues (re-)discovered and/or confirmed by work on PR networkupstools#3330 for issue networkupstools#1711 Tested-on: Linux (passes), macOS 12, FreeBSD 12, NetBSD 11, OpenBSD 6.5, OmniOS (amd64+i386), OpenIndiana (amd64+i386) - all compilers and C standard dialects in the CI matrix. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this pull request
Mar 8, 2026
…ng sockets [networkupstools#3331] The TLS handshake functions `SSL_accept()` (server) and `SSL_connect()` (client) require a retry loop when the underlying socket is in non-blocking mode. When either function returns '-1' with an error code of `SSL_ERROR_WANT_READ` or `SSL_ERROR_WANT_WRITE`, it is signalling a non-fatal "not done yet" condition: the handshake needs more I/O turns to complete. The correct response is to wait for the socket fd to become ready in the indicated direction and then call the same function again with the same SSL object (this is explicitly documented in OpenSSL for every version since 0.9.x and the API contract has never changed). Previously both call sites used a single-shot switch/case pattern that treated these non-fatal WANT_READ/WANT_WRITE returns as fatal errors, tearing down the connection immediately. On Linux the loopback socket is fast enough that the handshake *nearly always* completes in the first call, masking the bug. On BSD (FreeBSD, OpenBSD, NetBSD), macOS, and illumos-based systems (OmniOS, OpenIndiana) the loopback socket behaves differently and WANT_READ/WANT_WRITE are returned regularly, causing CI failures on all of those platforms regardless of compiler, C standard dialect, or OpenSSL version used. The fix is identical for all supported OpenSSL versions (0.9.x / 1.0.x / 1.1.x / 3.x): the `SSL_ERROR_WANT_*` codes and the required retry semantics have been stable since the library's inception. No NSS changes are needed: NSS uses `SSL_ForceHandshake()` which is already blocking-by-design through NSPR. Fixes issues (re-)discovered and/or confirmed by work on PR networkupstools#3330 for issue networkupstools#1711 Tested-on: Linux (passes), macOS 12, FreeBSD 12, NetBSD 11, OpenBSD 6.5, OmniOS (amd64+i386), OpenIndiana (amd64+i386) - all compilers and C standard dialects in the CI matrix. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This was referenced Mar 12, 2026
jimklimov
added a commit
that referenced
this pull request
Mar 12, 2026
…/NSS CA and server/client certs [#3330] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #3328
Largely fulfills #1711 (for the C client tests, but not for other ecosystems like C++ and Python)