cert ensure

Ensures that the certificate that Dev Proxy uses for decrypting SSL traffic is set up. Creates the certificate if it doesn't exist. Also, makes the certificate trusted.

Synopsis

devproxy cert ensure [options]

Options:
  --log-level <level>    Logging level: trace|debug|information|warning|error
  -h, --help             Show help

Usage

devproxy cert ensure

Arguments

None

Options

Name Description Allowed values Default
--log-level <loglevel> Level of messages to log trace, debug, information, warning, error information

Exit codes

Code Meaning
0 Success
1 Dev Proxy couldn't create or trust the certificate
2 Invalid input or usage

Linux

On Linux, Dev Proxy doesn't trust the certificate on first run, because trusting it requires sudo. Instead, it shows a warning to run devproxy cert ensure. When you run the command, Dev Proxy adds the certificate to the system certificate store and, if available, to the NSS database that Chrome and other NSS-based apps use.

System certificate store

Dev Proxy writes the certificate as devproxy-ca.crt to the CA anchors folder of your distribution and refreshes the store:

Distribution Anchors folder Refresh command
Debian/Ubuntu /usr/local/share/ca-certificates update-ca-certificates
Fedora/RHEL /etc/pki/ca-trust/source/anchors update-ca-trust extract
Arch /etc/ca-certificates/trust-source/anchors update-ca-trust extract

These commands run with sudo, so you might be asked for your password. When you run Dev Proxy as root, it runs the commands without sudo. When there's no terminal to prompt for the password, for example, when stdin is redirected or the CI environment variable is set, Dev Proxy runs sudo non-interactively. If sudo needs a password in that case, Dev Proxy creates the certificate but doesn't trust it, shows a warning, and exits with 0. To trust the certificate, run devproxy cert ensure in an interactive terminal.

If you previously trusted the certificate manually as dev-proxy-ca.crt, Dev Proxy removes that file after it trusts the certificate.

If Dev Proxy doesn't recognize your distribution, it saves the public certificate as devproxy-ca.crt in the current folder, shows a warning, and exits with 0. Add the certificate to the CA anchors of your system and refresh the certificate store. For more information, see your distribution's documentation.

NSS database

If certutil is installed, Dev Proxy also adds the certificate as Dev Proxy CA to the NSS database that Chrome uses: ~/.pki/nssdb if it exists, otherwise ~/.local/share/pki/nssdb. If certutil isn't installed, Dev Proxy shows which package to install:

Distribution Package
Debian/Ubuntu libnss3-tools
Fedora/RHEL nss-tools
Arch nss

After you install the package, run devproxy cert ensure again. If Dev Proxy trusts the certificate in the system store but can't add it to the NSS database, for example, because the database is password-protected, it shows a warning and exits with 0.

Firefox uses its own certificate store. To trust the certificate in Firefox, see Use Dev Proxy with a browser.

See also