Continuing the topic of installing certificates in the Ubuntu operating system, it is worth considering the procedure for installing them in Google Chrome. Next, we will give detailed instructions on how to add them.
How to add certificates to Google Chrome
If you decide to add a certificate to Google Chrome or Chromium in the GUI, open the settings from the main menu.
After that, you need to open Privacy and Security -> Security -> Configure certificates.
Then go to the "Certificate Authority".
Now you need to click the "Import" button and select the root certificate file.
At this stage, you need to configure the trust settings. The certificate will be used to confirm the authenticity of the sites, then you can leave only the first item:.
Once the certificate is added, you will no longer see information that the connection is not secure.
After that, you need to use the libnss3-tools package to work with certificates. You can install it by running:
sudo apt install libnss3-tools
The Google Chrome certificate database is located in the ~/.pki/nssdb folder. You can view the available certificates with the command:
certutil -d ~/.pki/nssdb -L
The syntax of the command to add a certificate is as follows:
$ certutil -d path/to/database/data -A -t "trust settings" -n "name" -i "/path/to/file"
We pay attention to trust. There are three groups of trust attributes, namely for:
SSL;
Email;
software and other objects.
Each of the groups can contain the following attributes:
p - valid pir;
P - trusted peer;
c - valid certification authority;
C - trusted certification authority;
T is a trusted certification authority for client authorization.
For SSL certificates, the sequence "TC,," will suffice. Attributes T and C for SSL and nothing for everything else. The whole command to import ca.crt will look like this:
certutil -d sql:~/.pki/nssdb -A -t "TC,," -n "Losst CA" -i ./ca.crt
After that you can look at the list of certificates again to make sure that everything is fine:
certutil -d sql:~/.pki/nssdb -L
This completes the instruction.