Skip to content

Commit c728add

Browse files
authored
Merge 470594b into fe4e6fe
2 parents fe4e6fe + 470594b commit c728add

9 files changed

Lines changed: 212 additions & 19 deletions

File tree

‎UPGRADING.adoc‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ The new `-A filename` option defaults to trying to use a `nutauth.conf` file
8888
but not failing if one is not usable; any specific values can require use
8989
of such a file or to not even try reading one ('none' as the legacy default).
9090
See the updated manual pages for more details. [issues #3329, #3411]
91+
+
92+
NOTE: In a future NUT release, the default `configure` script handling for the
93+
`--with-ssl-client-validation=auto` option may be changed from `no` to `yes`.
9194
9295
- The `upsmon` and `upsstats.cgi` clients capable of connections to multiple
9396
NUT data servers, potentially in separately managed security realms, now

‎ci_build.sh‎

Lines changed: 191 additions & 5 deletions
Large diffs are not rendered by default.

‎conf/upsd.conf.sample‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@
206206
# See 'docs/security.txt' or the Security chapter of NUT user manual
207207
# for more information on the SSL support in NUT.
208208
#
209-
# WARNING: Until https://github.com/networkupstools/nut/issues/3329 is solved,
210-
# not all stock NUT clients even have a way to present some certain certificate.
209+
# NOTE: You may have to use linkman:nutauth.conf[5] for stock and modernized
210+
# third-party NUT clients to even have a way to present some certain certificate.
211211

212212
# =======================================================================
213213
# DISABLE_WEAK_SSL <Boolean>

‎configure.ac‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ nut_ssl_lib=""
29152915
NUT_ARG_WITH([ssl], [enable SSL support (either NSS or OpenSSL)], [auto])
29162916
NUT_ARG_WITH([nss], [enable SSL support using Mozilla NSS], [auto])
29172917
NUT_ARG_WITH([openssl], [enable SSL support using OpenSSL], [auto])
2918-
NUT_ARG_WITH([ssl-client-validation], [enable SSL client certificate validation ability (currently requires NSS, beware issue #3329)], [auto])
2918+
NUT_ARG_WITH([ssl-client-validation], [enable SSL client certificate validation ability], [auto])
29192919

29202920
dnl Optionally reset/initialize the cache values shared by several backends
29212921
dnl if the check methods below never ran for all active code paths (one or more):
@@ -3001,7 +3001,8 @@ AS_CASE([${nut_with_ssl_client_validation}],
30013001
[yes|""], [nut_with_ssl_client_validation="yes"],
30023002
dnl TOTHINK: reject if openssl/none build?
30033003
[auto|*], [nut_with_ssl_client_validation="no"]
3004-
dnl Until #3329 is solved, auto==no
3004+
dnl Although #3329 is solved with NUT v2.8.5, for now keep auto==no
3005+
dnl TODO: Flip in a later release, e.g. v2.9.0?
30053006
)
30063007
NUT_REPORT_FEATURE([enable SSL client certificate validation],
30073008
[${nut_with_ssl_client_validation}], [],

‎docs/configure.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,8 @@ Enable the `upsd` server-side ability to set up `CERTREQUEST` directive in
803803
`upsd.conf`, which lets the server reject clients which do not present a
804804
certificate.
805805

806-
WARNING: Until link:https://github.com/networkupstools/nut/issues/3329[issue
807-
#3329] is solved, not all stock NUT clients may even have a way to present
808-
some certain certificate.
806+
NOTE: You may have to use linkman:nutauth.conf[5] for stock and modernized
807+
third-party NUT clients to even have a way to present some certain certificate.
809808

810809
Read link:docs/security.txt[] for instructions on practical setup of SSL
811810
support.

‎docs/man/upsd.conf.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ by default, see `docs/security.txt` in NUT sources), you can specify whether
233233
Up until NUT release v2.8.5 this was a no-op when built with OpenSSL.
234234
Now this feature is supported with both OpenSSL and NSS backends.
235235
+
236-
WARNING: Until link:https://github.com/networkupstools/nut/issues/3329[issue
237-
#3329] is solved, not all stock NUT clients may even have a way to present
238-
some certain certificate.
236+
NOTE: You may have to use linkman:nutauth.conf[5] for stock and modernized
237+
third-party NUT clients to even have a way to present some certain certificate.
239238
+
240239
Possible values are:
241240
+

‎docs/security.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,8 @@ NOTE: If the client does not send *any* certificate, the connection is closed.
620620
Like CA certificates, you can add many "trusted" client and CA certificates
621621
in server's certificate databases.
622622

623-
WARNING: Until link:https://github.com/networkupstools/nut/issues/3329[issue
624-
#3329] is solved, not all stock NUT clients may even have a way to present
625-
some certain certificate.
623+
NOTE: You may have to use linkman:nutauth.conf[5] for stock and modernized
624+
third-party NUT clients to even have a way to present some certain certificate.
626625

627626
upsmon (required): upsd authentication
628627
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

‎server/conf.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@ static int parse_upsd_conf_args(size_t numargs, char **arg)
317317
# ifdef WITH_CLIENT_CERTIFICATE_VALIDATION
318318
/* CERTREQUEST (0 | 1 | 2) */
319319
if (!strcmp(arg[0], "CERTREQUEST")) {
320-
if (starts_with_digit && str_to_int(arg[1], &n, 10)) {
320+
if (starts_with_digit && str_to_int(arg[1], &n, 10)
321+
&& n >= NETSSL_CERTREQ_MIN && n <= NETSSL_CERTREQ_MAX
322+
) {
321323
certrequest = n;
322324
return 1;
323325
}

‎server/netssl.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ extern int certrequest;
4545
/* Required (cnx failed if no certificate or invalid CA chain) */
4646
#define NETSSL_CERTREQ_REQUIRE 2
4747

48+
/* For range-checks */
49+
#define NETSSL_CERTREQ_MIN NETSSL_CERTREQ_NO
50+
#define NETSSL_CERTREQ_MAX NETSSL_CERTREQ_REQUIRE
51+
4852
/* Similar to upscli_ssl_caps_descr() for client library,
4953
* but with more bells and whistles */
5054
const char *net_ssl_caps_descr(void);

0 commit comments

Comments
 (0)