BB uses TLS certificates to ensure secure communication between the browser interface and the API server. This guide explains how certificates work in BB and how to manage them.
BB automatically handles TLS certificate creation and management. When you first initialize BB or enable TLS, it will:
- Create a local Certificate Authority (CA)
- Create a server certificate signed by that CA
- Add the CA to your system's trust store
Use the bb secure command to manage TLS:
bb secure on # Enable TLS (recommended)
bb secure off # Disable TLS (not recommended)
bb secure status # Check TLS statusYou can check your certificate status in two ways:
- Command Line:
bb secure status- Browser:
- Open the BB API status page at https://localhost:3162/api/v1/status
- View detailed certificate information and trust store status
BB stores certificates in your global BB configuration directory:
- macOS/Linux:
~/.config/bb/ - Windows:
%APPDATA%\bb\
Files:
localhost.pem: Your CA certificatelocalhost-key.pem: Your CA private keyCAcert.pem: Your server certificateCAcert-key.pem: Your server private key
BB adds the CA certificate to your system's trust store:
- macOS:
/Library/Keychains/System.keychain - Windows:
Cert:\LocalMachine\Root - Linux:
/usr/local/share/ca-certificatesor/etc/pki/ca-trust/source/anchors
When using a self-signed certificate, you may see security warnings in your browser. This is normal and expected.
- Click "Advanced"
- Click "Proceed to localhost (unsafe)"
- Click "Advanced..."
- Click "Accept the Risk and Continue"
- Click "Show Details"
- Click "visit this website"
- Click "Advanced"
- Click "Continue to localhost (unsafe)"
These warnings appear because your browser doesn't recognize our local certificate authority. The connection is still encrypted and secure for local development.
If your browser doesn't trust the certificate:
- Check the trust store status:
bb secure status - Try re-enabling TLS:
bb secure on - Check your system's trust store manually (see locations above)
If your certificate has expired:
- Run
bb secure onto generate new certificates - Restart the BB API server:
bb restart
If certificates are missing:
- Run
bb secure onto generate new certificates - Check the certificate locations (see above)
- Restart the BB API server:
bb restart
- Always use TLS (enabled by default)
- Keep your certificate files secure
- Regenerate certificates if they're compromised
- Monitor certificate expiry dates
- Back up your certificates when deploying
BB provides several configuration options for TLS:
api:
apiUseTls: true
tlsCertFile: "cert.pem" # Path to certificate file
tlsKeyFile: "key.pem" # Path to key file
tlsCertPem: "" # Inline certificate content
tlsKeyPem: "" # Inline key contentUse either file paths or inline PEM content, not both.