Skip to content

NSS on Debian Stretch with libnss3: Can not initialize SSL context #572

Closed

Description

@Luo2Jie2

I am unable to get 2.7.4 to work with NSS support as provided by
libnss3 2:3.26.2 on Debian stretch. Currently NSS supports two
database formats identified by prefixes "sql:" for the new database
and "dbm:" for the legacy database, but there is no way of specifying
them in 2.7.4.

I created the NSS database in directory /etc/nut with command
certutil -N -d dbm:NSS_db --empty-password

I copied over public key and certificate from a working NUT+OpenSSL
installation and checked them as follows: List certificates:
root@gold /etc/nut # certutil -L -d dbm:NSS_db
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
gold Cu,u,u

Check certificates:
root@gold /etc/nut → certutil -K -d dbm:NSS_db
certutil: Checking token "NSS Certificate DB" in slot
"NSS User Private Key and Certificate Services"
< 0> rsa df7b376946c8cfe59d74095dfc4b882d081b981b gold

File upsd.conf is
LISTEN 0.0.0.0 3493
CERTPATH /etc/nut/NSS_db
CERTIDENT gold sekret

Command systemctl start nut-server produces the message

Jul 10 15:02:51 gold upsd[15961]: Connected to UPS [heartbeat]: dummy-ups-heartbeat
Jul 10 15:02:51 gold upsd[15961]: Connected to UPS [Eaton]: usbhid-ups-Eaton
Jul 10 15:02:51 gold upsd[15961]: listening on 0.0.0.0 port 3493
Jul 10 15:02:51 gold upsd[15962]: Startup successful
Jul 10 15:02:51 gold upsd[15962]: Can not initialize SSL context

It looks as if legacy NSS_Init in netssl.c line 442 is unable
to access the libnss3 NSS_db database.

Roger

Activity

  1. stratege1401 commented on Aug 12, 2018

    @stratege1401

    Hello,

    i think we have a related bug.

    #563

  2. Luo2Jie2 commented on Aug 12, 2018

    @Luo2Jie2
    Author
  3. added
    SSL/NSS
    on Nov 14, 2021
  4. Gooberpatrol66 commented on Dec 12, 2021

    @Gooberpatrol66

    I believe I am having this same problem.

  5. trallnag commented on Jan 31, 2024

    @trallnag

    Same here. Hmm, I wonder if the OpenSSL integration works better. Too bad on Ubuntu / Debian nut is compiled without OpenSSL support.

  6. added
    Linux
    impacts-release-2.7.4
    Debian Linux ecosystem
    on Feb 26, 2026
  7. jimklimov commented on Mar 12, 2026

    @jimklimov
    Member

    Hopefully fixed with recent merges to the master branch (for more context see #3344, #3330, #1711). At the very least, the current code base should be more debug-able (if you turn up the daemon verbosity, see https://github.com/networkupstools/nut/wiki/Changing-NUT-daemon-debug-verbosity).

    Testing welcome, with eventual v2.8.5 release or custom builds of the master branch before that, see https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests

    Until #3331 gets addressed, NSS support actually handles the more functional of the two crypto backends we have now.

  8. added this to the 2.8.6 milestone on Mar 12, 2026
  9. jimklimov commented on May 11, 2026

    @jimklimov
    Member

    With #3331 recently resolved, now (on the master branch and in future NUT v2.8.6+ releases), the NSS and OpenSSL builds should be functionally equivalent.

    Presuming this fixes the issue; feel free to re-open if the problem can be reproduced with current code. Bump debug verbosity and post logs then, please, so it is easier to figure out what went wrong :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Debian Linux ecosystemLinuxSSL/NSSbugimpacts-release-2.7.4

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions