Overview
Thetrust command adds the Portless local Certificate Authority (CA) to your system’s trust store. This eliminates browser warnings when using HTTPS with the --https flag.
Syntax
When to Use
You need to runportless trust if:
- You’re using
portless proxy start --https - You see browser certificate warnings
- You skipped the trust step when first starting the proxy with HTTPS
How It Works
Portless generates a local CA certificate the first time you runportless proxy start --https. The trust command adds this CA to your system trust store so browsers recognize certificates signed by it.
macOS
Adds the CA to the System keychain using thesecurity command. Does not require sudo on macOS.
Linux
Supports multiple distributions:- Debian/Ubuntu: Uses
update-ca-certificates - Arch: Uses
update-ca-trust - Fedora/RHEL/CentOS: Uses
update-ca-trust - openSUSE: Uses
update-ca-certificates
Examples
Trust on macOS
Trust on Linux
First-Time HTTPS Setup
When you first start the proxy with--https, it prompts to add the CA:
portless trust later:
Check if CA is Trusted
The CA trust status is checked automatically when starting the proxy. If not trusted, you’ll see:Errors
Permission Denied (Linux)
Unsupported System
If your system doesn’t support automatic CA trust:~/.portless/ca.pem (or /tmp/portless/ca.pem for privileged ports) into your browser.
Manual Trust (Alternative)
If automatic trust fails, you can manually import the CA:Find the CA Certificate
For default port (1355):Import to Browser
Chrome/Edge:- Settings > Privacy and Security > Security > Manage certificates
- Authorities tab > Import
- Select
ca.pem - Check “Trust this certificate for identifying websites”
- Settings > Privacy & Security > Certificates > View Certificates
- Authorities tab > Import
- Select
ca.pem - Check “Trust this CA to identify websites”
- Double-click
ca.pemto add to Keychain - Open Keychain Access
- Find “Portless Local CA”
- Double-click > Trust > Always Trust
Security Notes
- The CA private key is stored locally in your state directory
- The CA is only trusted on your machine
- Certificates are valid for 825 days (maximum allowed by browsers)
- The CA is automatically generated per state directory (port-specific)
Related Commands
portless proxy start --https- Start proxy with HTTPS
Exit Codes
- 0 - Success (CA trusted)
- 1 - Error (permission denied, unsupported system, CA not found)