Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5b72d2d
Introduce and use methods to query and report SSL support in libupscl…
jimklimov Feb 21, 2026
ec931bf
clients/upsclient.c: also report NUT source version the library was b…
jimklimov Feb 25, 2026
80c97a5
clients/upsclient.c: upscli_sslinit(): condense WITH_SSL/!WITH_SSL in…
jimklimov Feb 25, 2026
f6f058a
clients/upsclient.c, conf/upsmon.conf.sample.in, docs/man/upsmon.conf…
jimklimov Feb 25, 2026
0b9b712
drivers/main.h: upsdrv_callbacks: we now have in fact 16 not 9 pointe…
jimklimov Feb 26, 2026
7e33263
drivers/main.h: upsdrv_callbacks: move magic to start of struct [#2800]
jimklimov Feb 26, 2026
d543ed9
drivers/main.h: upsdrv_callbacks: document the macros [#2800]
jimklimov Feb 26, 2026
fe32e78
m4/ax_c_pragmas.m4, drivers/main.c: handle "-Wmissing-braces" for ups…
jimklimov Mar 1, 2026
a033d59
tests/NIT/nit.sh: detect run-time behavior of WITH_SSL* in built clie…
jimklimov Feb 25, 2026
5fc39e4
tests/NIT/nit.sh, NEWS.adoc: introduce generation of upsmon/upsd conf…
jimklimov Feb 25, 2026
319ad07
tests/NIT/nit.sh: SSL tests: check for presence of third-party toolin…
jimklimov Feb 26, 2026
c550fbf
tests/NIT/nit.sh: generatecfg_upsd_add_SSL(), generatecfg_upsmon_add_…
jimklimov Feb 26, 2026
504b6c3
tests/NIT/nit.sh: populate OpenSSL and/or Mozilla NSS keystores if we…
jimklimov Feb 26, 2026
d4d20b7
tests/NIT/nit.sh: add server/client-side SSL configs for tests with u…
jimklimov Feb 26, 2026
22734dd
tests/NIT/nit.sh: fix running as a script from root or tests director…
jimklimov Feb 26, 2026
d0af6a5
tests/NIT/nit.sh: leave a commented stub for OpenSSL SSL_CERT_DIR hac…
jimklimov Feb 26, 2026
c521a42
configure.ac and docs: introduce --with-ssl-client-validation option …
jimklimov Feb 26, 2026
a19c8bd
server/conf.c and docs: Extended processing of `CERTREQUEST` setting …
jimklimov Feb 26, 2026
e533c1d
docs/config-prereqs.txt: add packages for `openssl` and `certutil` wh…
jimklimov Feb 26, 2026
90e5afa
server/upsd.c: mainloop(POSIX): log in more detail why we disconnect …
jimklimov Feb 27, 2026
8fe772c
server/netssl.c: net_starttls(): reject clients without any cert if W…
jimklimov Feb 27, 2026
c01e67a
clients/upsc.c: revise failure logging [#1711]
jimklimov Feb 27, 2026
c2c58cd
clients/upsclient.c: upscli_strerror(): revise failure logging with N…
jimklimov Feb 27, 2026
35ef151
tests/NIT/nit.sh: adjust TESTCERT_PATH_* to WIN32 runs if needed [#1711]
jimklimov Feb 27, 2026
0e4d3a4
*/Makefile.am: revise libupsclient* dependencies to honour ENABLE_SHA…
jimklimov Feb 28, 2026
628e412
appveyor.yml: enable possibility of NSS builds (and confirm OpenSSL) …
jimklimov Feb 28, 2026
64852dd
clients/upsclient.{c,h}, docs: introduce upscli_set_debug_level() and…
jimklimov Feb 28, 2026
f7ec803
clients/upsmon.c: use `upscli_set_debug_level(nut_debug_level)` where…
jimklimov Feb 28, 2026
41f12ce
clients/*.c, drivers/dummy-ups.c, tools/nut-scanner/scan_nut.c: fix l…
jimklimov Feb 28, 2026
ddd1198
tests/NIT/nit.sh: fix running OpenSSL tests on Windows [#1711]
jimklimov Feb 28, 2026
cd41f31
tests/NIT/nit.sh: add a way to run WITHOUT_SSL_TESTS on platforms kno…
jimklimov Feb 28, 2026
25f0a33
tests/NIT/Makefile.am: default to run WITHOUT_SSL_TESTS for OpenSSL b…
jimklimov Feb 28, 2026
f2db253
docs/security.txt, docs/nut.dict: add a note on checking SSL support …
jimklimov Feb 28, 2026
0d8ecf6
common/common-nut_version.c: add comments to clarify LIBNUTPRIVATE_UP…
jimklimov Mar 1, 2026
f3ac50b
ci_build.sh, scripts/Windows/build-mingw-nut.sh, NEWS.adoc: introduce…
jimklimov Mar 1, 2026
c149f6f
appveyor.yml: pass NUT_SSL_VARIANTS=nss to the builds, so we have som…
jimklimov Mar 1, 2026
4b25034
tests/NIT/nit.sh: disable NUT_QUIET_INIT_SSL when we actually test SS…
jimklimov Mar 1, 2026
7396576
clients/upsclient.c: report in log if Certificate verification (by cl…
jimklimov Mar 1, 2026
15c78db
tests/NIT/nit.sh: fix use of CERTPATH with OpenSSL tests [#1711]
jimklimov Mar 1, 2026
538c287
tests/NIT/Makefile.am: re-allow running OpenSSL tests by default [#1711]
jimklimov Mar 1, 2026
af5da88
tests/NIT/Makefile.am: OpenSSL remains flaky on many platforms, work …
jimklimov Mar 2, 2026
88cb9b0
NEWS.adoc, UPGRADING.adoc: update document intro paragraphs
jimklimov Mar 4, 2026
330612f
clients/Makefile.am: fix dependency between upsclient.c and nut_versi…
jimklimov Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ all-libs-local/common: all-libs-local/include @dotMAKE@
### Delivers: libupsclient.la libnutclient.la libnutclientstub.la
### Delivers: libupsclient-version.h
### LIB-Requires-ext: common/libcommonclient.la
### Requires-ext: include/nut_version.h
### Requires-ext: common/libcommon.la common/libcommonclient.la
### Requires-ext: common/libcommonversion.la
### Requires-ext: common/libparseconf.la
Expand Down
26 changes: 25 additions & 1 deletion NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ NUT Release Notes
=================
endif::txt[]

If you're upgrading from an earlier version, see the link:UPGRADING.adoc[] file.
This document summarizes the practical side of changes coming with each
newer release development, as compared to the preceding release.

If you're upgrading from an earlier version, or are a package maintainer,
please see also the link:UPGRADING.adoc[] file about anticipated impacts
of ongoing development on existing deployments and third-party consumers.

Please note that web and source document links, product and service names
listed in historic entries of past releases may no longer be relevant.
Expand Down Expand Up @@ -104,6 +109,16 @@ https://github.com/networkupstools/nut/milestone/12
characters. Now it is evaluated at `configure` time (to check that the
characters may be used), and if not -- during `nut_stdint.h` parsing to
fit known `int`/`long`/`long long` types. [#3300]
* Added new API methods and defined bitmap values for `libupsclient`
C binding to query and report SSL capabilities of the current library
build (none, OpenSSL, Mozilla NSS): `upscli_ssl_caps_descr()` and
`upscli_ssl_caps()`. Updated common NUT clients to report this info
in their detailed help banners. Done similarly for `upsd`. The NIT
(NUT Integration Test) suite piggy-backs on this to add run-time
dependent tests of SSL capability. Added `upscli_set_debug_level()`
and `upscli_set_debug_level()` methods to facilitate NUT debugging
for clients built with shared NUT private libraries. [issues #3328,
#1771, #2800, PR #3330]

- NUT for Windows specific updates:
* Revised detection of (relative) paths to program and configuration files
Expand Down Expand Up @@ -302,6 +317,11 @@ https://github.com/networkupstools/nut/milestone/12
or Windows `HANDLE`'s at a time, and moving on to another chunk.
The system-provided value can be further limited by `NUT_SYSMAXCONN_LIMIT`
environment variable (e.g. in tests). [#3302]
* Extended processing of `CERTREQUEST` setting to handle numeric or specific
string values, to match both ways of reading ambiguous documentation.
Added `configure --with-ssl-client-validation` toggle to expose the
macro previously meant to be passed via `make` command line. [PR #3330,
but beware issue #3329]

- `upsdrvctl` tool updates:
* Make use of `setproctag()` and `getproctag()` to report parent/child
Expand Down Expand Up @@ -530,6 +550,10 @@ several `FSD` notifications into one executed action. [PR #3097]
* Dropped the `compile` script from Git sources. It originates from automake
and is added to work area (if missing) during `autogen.sh` rituals anyway.
It is still distributed as part of `make dist` tarball. [#1209]
* Extended `ci_build.sh` and `build-mingw-nut.sh` so that certain values
of `NUT_SSL_VARIANTS=[yes, no, auto, ssl, nss, openssl]` can be used
with generic builds to test a specific code path and not only the
auto-detected one. [#1711]

- Upstreamed reference packaging recipes (DEB, RPM) from the 42ITy project
which can be used with OBS (Open Build Service by SUSE), both to support
Expand Down
19 changes: 17 additions & 2 deletions UPGRADING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ Upgrading notes
endif::txt[]

This file lists changes that affect users who installed older versions
of this software. When upgrading from an older version, be sure to
check this file to see if you need to make changes to your system.
of this software, or third-party integrations and library or data consumers.
When upgrading from an older NUT version, be sure to check this file to
see if you need to make changes to your system.

We welcome feedback from package maintainers -- if you had to patch something
out, or work around something in NUT code or recipes, please let us know in
the issue tracker. Chances are, other distributions feel your pain, and some
generalized solution belongs in the upstream project as an easy to use build
configuration toggle to be shared by all interested downstream projects.

[NOTE]
======
Expand Down Expand Up @@ -35,6 +42,10 @@ Changes from 2.8.4 to 2.8.5
library files to deliver with the packages (formally versioned and
named by NUT release semantic version triplet). [issue #2800]

- Related to the above, `libupsclient` will remove the exported symbol for
`nut_debug_level` variable in a later NUT release, and now introduces the
`upscli_set_debug_level()` and `upscli_get_debug_level()` methods. [PR #3330]

- For ages, most recipes for building NUT had customized the `sysconfdir` to
be `/etc/nut`, which is not exactly the *system* configuration directory.
This is finally deprecated, with new `--with-confdir` configuration option
Expand Down Expand Up @@ -99,6 +110,10 @@ Changes from 2.8.4 to 2.8.5
use `upsdrvquery_NOSIGPIPE=0` to disable neutering of the signal inside
the API itself. [PR #3277]

- Added new API methods and defined bitmap values for `libupsclient` C binding
to query and report SSL capabilities of the library build (none, OpenSSL,
Mozilla NSS): `upscli_ssl_caps_descr()` and `upscli_ssl_caps()`. [PR #33xx]

- Fixed man page naming for `nutdrv_siemens-sitop(.8)` (dash vs. underscore)
to match the driver program name. Packaging recipes may have to be updated.
Follow-up from slightly botched renaming in original contribution. [PR #545]
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ install:
# versions of packages.
- cmd: |
REM Prerequisites for NUT per https://github.com/networkupstools/nut/blob/master/docs/config-prereqs.txt :
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit"
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit mingw-w64-x86_64-nss mingw-w64-x86_64-openssl"
REM SKIP mingw-w64-x86_64-libmodbus-git : we custom-build one with USB support
REM SKIP for now NUT-Monitor prereqs (runtime Python would require somilar modules; need to fix localization builds like "fr.po"): gettext mingw-w64-x86_64-python-pyqt6

Expand Down Expand Up @@ -115,7 +115,7 @@ build_script:
REM to find "nearby" program or configuration files (see common.c
REM for current implementation). Hard-coded fallback strings may
REM end up getting used in those cases.
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" CI_SKIP_CHECK=true CANBUILD_WITH_LIBMODBUS_USB=yes WITH_LIBNUTPRIVATE=true ./ci_build.sh --with-docs=no'
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" CI_SKIP_CHECK=true CANBUILD_WITH_LIBMODBUS_USB=yes WITH_LIBNUTPRIVATE=true NUT_SSL_VARIANTS=nss ./ci_build.sh --with-docs=no'


after_build:
Expand Down
33 changes: 32 additions & 1 deletion ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ SCRIPT_ARGS=("$@")
# in a different directory and then it would be used with a warning. This may
# require that you `make distclean` the original source checkout first:
# CI_BUILDDIR=obj BUILD_TYPE=default-all-errors ./ci_build.sh
#
# The NUT_SSL_VARIANTS=[yes, no, auto, ssl, nss, openssl] values can be used
# with generic builds (not only iteration of a default-all-errors* matrix)
# to set specific SSL options in tested NUT builds.
#
case "$BUILD_TYPE" in
fightwarn) ;; # for default compiler
fightwarn-all)
Expand Down Expand Up @@ -1947,7 +1952,20 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-al

case "$BUILD_TYPE" in
"default-all-errors"*) ;; # Treated below
*) configure_nut ;;
*) # Final choices that can conflict with the matrix
# tried in default-all-errors* builds
case "${NUT_SSL_VARIANTS}" in
ssl|nss|openssl)
CONFIG_OPTS+=("--with-${NUT_SSL_VARIANTS}")
;;
yes) CONFIG_OPTS+=("--with-ssl") ;;
no) CONFIG_OPTS+=("--without-ssl") ;;
auto) CONFIG_OPTS+=("--with-ssl=auto") ;;
"") ;;
*) echo "WARNING: Unrecognized NUT_SSL_VARIANTS='${NUT_SSL_VARIANTS}' for a general deterministic build, ignored" >&2 ;;
esac
configure_nut
;;
esac

# NOTE: There is also a case "$BUILD_TYPE" above for setting CONFIG_OPTS
Expand Down Expand Up @@ -2842,6 +2860,17 @@ bindings)
CONFIG_OPTS+=("--enable-shared-private-libs")
fi

case "${NUT_SSL_VARIANTS}" in
ssl|nss|openssl)
CONFIG_OPTS+=("--with-${NUT_SSL_VARIANTS}")
;;
yes) CONFIG_OPTS+=("--with-ssl") ;;
no) CONFIG_OPTS+=("--without-ssl") ;;
auto) CONFIG_OPTS+=("--with-ssl=auto") ;;
"") ;;
*) echo "WARNING: Unrecognized NUT_SSL_VARIANTS='${NUT_SSL_VARIANTS}' for a general deterministic build, ignored" >&2 ;;
esac

if [ -n "${BUILD_DEBUGINFO-}" ]; then
CONFIG_OPTS+=("--with-debuginfo=${BUILD_DEBUGINFO}")
else
Expand Down Expand Up @@ -2987,6 +3016,8 @@ cross-windows-mingw*)
fi # else we have some value from caller
export WITH_LIBNUTPRIVATE

export NUT_SSL_VARIANTS

SOURCEMODE="out-of-tree" \
MAKEFLAGS="$PARMAKE_FLAGS" \
KEEP_NUT_REPORT_FEATURE="true" \
Expand Down
22 changes: 21 additions & 1 deletion clients/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,42 @@ upsstats_cgi_LDADD = $(LDADD_CLIENT) $(top_builddir)/common/libcommonstrjson.la

# not LDADD... why?
libupsclient_la_SOURCES = upsclient.c upsclient.h
# NOTE: The library does not require libcommonversion.la
if ENABLE_SHARED_PRIVATE_LIBS
libupsclient_la_LIBADD = \
$(top_builddir)/common/libnutprivate-@NUT_SOURCE_GITREV_SEMVER_UNDERSCORES@-common-client.la
else !ENABLE_SHARED_PRIVATE_LIBS
libupsclient_la_LIBADD = \
$(top_builddir)/common/libcommonclient.la
endif !ENABLE_SHARED_PRIVATE_LIBS
if HAVE_WINDOWS_SOCKETS
libupsclient_la_LIBADD += -lws2_32
endif HAVE_WINDOWS_SOCKETS
if WITH_SSL
libupsclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS)
endif WITH_SSL

# NOTE: The library does not require libcommonversion.la (does not
# link against it), we just need $(top_builddir)/include/nut_version.h
# to be there first (needed to compile upsclient.c, but not all `make`
# implementations are happy for out-of-tree builds if we define a
# dependency between these two files directly).
libupsclient.la: $(top_builddir)/common/libcommonversion.la

# Below we set API versions of public libraries
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# Note that changes here may have to be reflected in packaging (the shared
# object .so names would differ)

# libupsclient version information
# NOTE: with libnutprivate*common* builds dynamically linked into the same
# program (a typical in-tree NUT client, not typical for out-of-tree third
# party clients) we can end up with two copies of libcommon symbols present
# in each library. It's recommended to explicitly call upscli_set_debug_level()
# instead of ambiguously manipulating the nut_debug_level variable by name.
# TOTHINK: Un-export nut_debug_level from this library to avoid ambiguity
# for the run-time dynamic linker resolution? For now the shared-library
# builds are "exotic", but it makes sense to deprecate this export in a
# future release.
libupsclient_la_LDFLAGS = -version-info 7:0:0
libupsclient_la_LDFLAGS += -export-symbols-regex '^(upscli_|nut_debug_level)'
#|s_upsdebug|fatalx|fatal_with_errno|xcalloc|xbasename|print_banner_once)'
Expand Down
16 changes: 11 additions & 5 deletions clients/upsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
Copyright (C) 2012 Arnaud Quette <arnaud.quette@free.fr>
Copyright (C) 2020-2025 Jim Klimov <jimklimov+nut@gmail.com>
Copyright (C) 2020-2026 Jim Klimov <jimklimov+nut@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -48,14 +48,14 @@ static void fatalx_error_json_simple(int msg_is_simple, const char *msg) {
if (output_json) {
if (msg_is_simple) {
/* Caller knows there is nothing to escape here, pass through */
printf("{\"error\": \"%s\"}\n", msg);
printf("{\"error\": \"%s\"}\n", NUT_STRARG(msg));
} else {
printf("{\"error\": \"");
json_print_esc(msg);
printf("\"}\n");
}
}
fatalx(EXIT_FAILURE, "Error: %s", msg);
fatalx(EXIT_FAILURE, "Error: %s", NUT_STRARG(msg));
}

static void usage(const char *prog)
Expand Down Expand Up @@ -91,6 +91,7 @@ static void usage(const char *prog)
printf(" -h - display this help text\n");

nut_report_config_flags();
upscli_report_build_details();

printf("\n%s", suggest_doc_links(prog, NULL));
}
Expand Down Expand Up @@ -168,6 +169,8 @@ static void list_vars(void)
int msg_is_simple = 1;

/* check for an old upsd */
upsdebugx(1, "%s: got code %d, upserror %d",
__func__, ret, upscli_upserror(ups));
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
msg = "upsd is too old to support this query";
} else {
Expand All @@ -177,14 +180,14 @@ static void list_vars(void)

if (output_json) {
if (msg_is_simple) {
printf(" \"error\": \"%s\"\n}\n", msg);
printf(" \"error\": \"%s\"\n}\n", NUT_STRARG(msg));
} else {
printf(" \"error\": \"");
json_print_esc(msg);
printf("\"\n}\n");
}
}
fatalx(EXIT_FAILURE, "Error: %s", msg);
fatalx(EXIT_FAILURE, "Error: %s", NUT_STRARG(msg));
}

while (upscli_list_next(ups, numq, query, &numa, &answer) == 1) {
Expand Down Expand Up @@ -237,6 +240,8 @@ static void list_upses(int verbose)
int msg_is_simple = 1;

/* check for an old upsd */
upsdebugx(1, "%s: got code %d, upserror %d",
__func__, ret, upscli_upserror(ups));
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
msg = "upsd is too old to support this query";
} else {
Expand Down Expand Up @@ -394,6 +399,7 @@ int main(int argc, char **argv)
s = getenv("NUT_DEBUG_LEVEL");
if (s && str_to_int(s, &i, 10) && i > 0) {
nut_debug_level = i;
upscli_set_debug_level(nut_debug_level);
}
upsdebugx(1, "Starting NUT client: %s", prog);

Expand Down
Loading
Loading