<div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br><br></div>I spent quite some time pulling my hair out and trying to figure out why NUT wasn't working properly with SSL enabled. I tried several approaches until I found something interesting.<br><br></div>I'm using NUT 2.7.1 in Ubuntu Server 14.04 Trusty Tahr<br><br></div>After properly configuring a self signed certificate with "certutil" from libnss3-tools, there was no way to get proper SSL connection eventhough upsd didn't complain in logs.<br><br></div>Shell# upsc TEST<br>Init SSL without certificate database<br>Connecting in SSL to 'localhost' (no certificate name specified)<br>Error while connecting to localhost, disconnect<br>Error: Unknown error<br><br></div>I then tried, for the sake of understanding, to compile the package in a test environment with OpenSSL support instead of LibNSS and it worked right away without trouble, provided I supplied the PEM "crt + key" combo file.<br><br></div>Back to the regular distro packages, I really tried hard to understand what was wrong until I managed to get it working!<br><br></div>Putting - UPSD_OPTIONS="-D" - in /etc/nut/nut.conf and "service nut-server restart" (which does not detach from the shell of course) made the whole system work! "upsmon" was happy as well as "upsc TEST" too!<br><br></div>Shell# upsc TEST<br><div><div><div><div><div>Init SSL without certificate database<br>Connecting in SSL to 'localhost' (no certificate name specified)<br>Do not intend to authenticate server localhost<br>SSL handshake done successfully with server localhost<br>Connected to localhost in SSL<br>Certificate verification is disabled<br>[...]<br><br></div><div>I first thought this was "start-stop-daemon" fault so I tried in standalone mode.<br><br></div><div>Shell# /lib/nut/dummy-ups -a TEST<br></div><div>Shell# upsd<br><br></div><div>Shell# ps axu<br>[...]<br>nut      19116  0.0  0.0  37688   772 ?        Ss   18:35   0:00 /lib/nut/dummy-ups -a APC<br>nut      19119  0.0  0.0  77296  6548 ?        Ss   18:36   0:00 upsd<br><br></div><div>Here, trying "upsc TEST" fails again!<br><br></div><div>So, there's definitely something wrong here when "upsd" detaches itself from the calling shell which makes SSL choke, at least with LibNSS!<br></div><div><br></div><div>I've browsed the GIT commit history from release 2.7.1 to current state and I didn't see any commit that would make me think the problem was already addressed.<br><br></div><div>Could someone look into it please? :-)<br></div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature">Unix _IS_ user friendly, it's just selective about who its friends are.</div>
</div></div></div></div></div></div></div></div></div></div></div></div></div>