I am trying to write an script (postinst for a .deb package) that will install a secure websockets (wss:) application and a certificate that allows access from the Chrome browser. The developer has this working by adding a certificate to the user's nssdb using certutil -A -d sql:$HOME/.pki/nssdb
How do I do this from an installer script? I've tried sudo -u $SUDO_USER
, which works if the user uses the commandline sudo dpkg
but doesn't work from something like Ubuntu Software Centre which runs as root. Is there a better way of doing it such as a system-wide database. I tried /etc/pki/nssdb
which I'd seen somewhere but that wasn't being picked up by Chrome.
/etc/ssl/certs
serve your purpose? – Gilles Jun 12 at 22:17update-ca-certificates
to install our certificate from/usr/local/share/ca-certificates/
but that doesn't seem to be enough; Chrome gives an error NET::ERR_CERT_AUTHORITY_INVALID when it tries to connect to the libwebsockets based server. – Paul Jun 15 at 10:27