FiloSottile / mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.
https://mkcert.dev
BSD 3-Clause "New" or "Revised" License
48.79k stars 2.52k forks source link

certutil: could not authenticate to token NSS Certificate DB.: SEC_ERROR_IO: An I/O error occurred during security authorization. #150

Open devsumanmdn opened 5 years ago

devsumanmdn commented 5 years ago

I tried looking an old issue #12, but it doesn't seem to help

Commands I have executed: sudo chmod u+x ./mkcert, and tried this also later sudo chmod 0777 ./mkcert, then sudo ./mkcert -install I have libnss3-tools version 2:3.28.4-0ubuntu0.16.04.5 installed which seems the latest for Ubuntu 16.04 LTS

Using the local CA at "/home/user/.local/share/mkcert" ✨
ERROR: failed to execute "certutil -A": exit status 255

certutil: could not authenticate to token NSS Certificate DB.: SEC_ERROR_IO: An I/O error occurred during security authorization.
adamdecaf commented 5 years ago

From https://www.redhat.com/archives/pki-users/2009-April/msg00037.html

Side note: the i/o error happens because of the missing NSS db files, either wrong alias directory with -d, or need a certutil -N -d to create them.

Have you started Firefox and/or Chrome and loaded a webpage? I needed to do that on a fresh linux machine with certutil before.

devsumanmdn commented 5 years ago

Have you started Firefox and/or Chrome and loaded a web page? I needed to do that on a fresh linux machine with certutil before.

Ya Chrome and Firefox both are loading web pages without an issue, and the Ubuntu installation is old also. And as long as I have gathered certutil -A automatically creates a database if needed, still not sure about the source of this error.

Alek5andr commented 4 years ago

Still searching for a solution...

fiialo commented 2 years ago

Fixed by creating a new NSS database: certutil -N -d <nss_db location>