Linux Certificate Setup
This guide covers installing the NectoProxy root CA certificate on various Linux distributions. Because Linux does not have a single unified certificate store, the process varies by distribution and by application.
Ubuntu / Debian
Copy the certificate to the system CA directory:
bashsudo cp ~/.nectoproxy/certs/ca.pem /usr/local/share/ca-certificates/nectoproxy-ca.crtFile Extension
The file must have a
.crtextension in theca-certificatesdirectory. Even though NectoProxy generatesca.pem, rename it to.crtwhen copying.Update the system certificate store:
bashsudo update-ca-certificatesYou should see output like:
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.Verify the certificate was added:
bashls /etc/ssl/certs/ | grep -i necto
Fedora / RHEL / CentOS
Copy the certificate to the system trust anchors:
bashsudo cp ~/.nectoproxy/certs/ca.pem /etc/pki/ca-trust/source/anchors/nectoproxy-ca.pemUpdate the CA trust store:
bashsudo update-ca-trustVerify:
bashtrust list | grep -i necto
Arch Linux / Manjaro
Copy the certificate:
bashsudo cp ~/.nectoproxy/certs/ca.pem /etc/ca-certificates/trust-source/anchors/nectoproxy-ca.crtUpdate the trust store:
bashsudo update-ca-trustVerify:
bashtrust list | grep -i necto
openSUSE
Copy the certificate:
bashsudo cp ~/.nectoproxy/certs/ca.pem /etc/pki/trust/anchors/nectoproxy-ca.pemUpdate the trust store:
bashsudo update-ca-certificates
Chrome / Chromium on Linux
Chrome and Chromium on Linux use the NSS shared database for certificate management, not the system CA store. Even after installing the certificate at the system level, Chrome may not trust it unless you also add it to the NSS database.
Install certutil
You need the certutil tool from the NSS tools package:
# Ubuntu / Debian
sudo apt install libnss3-tools
# Fedora / RHEL
sudo dnf install nss-tools
# Arch Linux
sudo pacman -S nssAdd the Certificate to the NSS Database
certutil -d sql:$HOME/.pki/nssdb -A \
-t "C,," \
-n "NectoProxy CA" \
-i ~/.nectoproxy/certs/ca.pemWhat the Flags Mean
-d sql:$HOME/.pki/nssdb-- The NSS database directory used by Chrome.-A-- Add a certificate.-t "C,,"-- Trust attributes:C= trusted CA for SSL, the two commas mean no trust for email or object signing.-n "NectoProxy CA"-- A human-readable nickname for the certificate.-i-- Input file path.
Create the NSS Database (If It Doesn't Exist)
If the NSS database directory does not exist, create it first:
mkdir -p $HOME/.pki/nssdb
certutil -d sql:$HOME/.pki/nssdb -N --empty-passwordThen run the certutil -A command above.
Verify in Chrome
certutil -d sql:$HOME/.pki/nssdb -LYou should see "NectoProxy CA" listed with trust attributes C,,.
Remove the Certificate from NSS
certutil -d sql:$HOME/.pki/nssdb -D -n "NectoProxy CA"Verify System-Level Installation
After installing the certificate at the system level, verify it with curl or openssl:
Using curl
# Configure your terminal to use the proxy
export http_proxy=http://localhost:8888
export https_proxy=http://localhost:8888
# This should succeed without --insecure
curl https://example.comIf the certificate is correctly installed, curl will complete without SSL errors.
Using openssl
openssl verify -CApath /etc/ssl/certs ~/.nectoproxy/certs/ca.pemRemoving the Certificate
Ubuntu / Debian
sudo rm /usr/local/share/ca-certificates/nectoproxy-ca.crt
sudo update-ca-certificates --freshFedora / RHEL
sudo rm /etc/pki/ca-trust/source/anchors/nectoproxy-ca.pem
sudo update-ca-trustArch Linux
sudo rm /etc/ca-certificates/trust-source/anchors/nectoproxy-ca.crt
sudo update-ca-trustTroubleshooting
curl Works but Chrome Does Not
This means the system CA store is correctly configured, but Chrome's NSS database does not have the certificate. Follow the Chrome / Chromium on Linux section above to add the certificate to the NSS database.
Firefox Ignores the System Certificate
Firefox uses its own certificate store, independent of both the system CA store and the NSS database used by Chrome. See the Firefox Certificate Setup guide.
"update-ca-certificates" Command Not Found
Install the ca-certificates package:
# Ubuntu / Debian
sudo apt install ca-certificates
# Fedora / RHEL
sudo dnf install ca-certificatesCertificate File Not Found
Make sure NectoProxy has been run at least once to generate the CA certificate:
nectoproxy startThen check the certificate exists:
ls -la ~/.nectoproxy/certs/ca.pemOr use:
nectoproxy cert --pathNode.js Applications Behind the Proxy
Node.js does not use the system CA store by default. If you are proxying Node.js applications, set the NODE_EXTRA_CA_CERTS environment variable:
export NODE_EXTRA_CA_CERTS=~/.nectoproxy/certs/ca.pemAdd this to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc) to make it persistent.