🛠️ Real incident, fixed with AI

Fixing Bitwarden "Failed to fetch" Against Self-Hosted Vaultwarden

A TLS certificate name mismatch made the Bitwarden client fail to reach a self-hosted Vaultwarden server.

In short

The Vaultwarden website answered, but the Bitwarden add-on in Chromium said it could not fetch the vault. The certificate (the site’s HTTPS ID) named a hostname, and the add-on was using the raw IP address. Pick one hostname, put that name on the certificate, and use that HTTPS address in the add-on. The commands are short. The wait is DNS and the new certificate.

If you would rather not manage a private CA, split DNS, and TLS name renewals for Vaultwarden yourself, a hosted manager can take that work. Proton Pass (affiliate link) is one end-to-end encrypted option that handles TLS and hosting.

What you need

See the name on the certificate

  1. Read the certificate the server presents:
openssl s_client -connect VAULT_HOST:PORT -servername VAULT_HOST \
  </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
  1. Open the HTTPS site:
curl -v https://VAULT_HOST:PORT/
  1. If DNS is not ready, test the hostname against one address without changing DNS:
curl -v --resolve vault.example.internal:PORT:SERVER_IP \
  https://vault.example.internal:PORT/

You should see the hostname in the certificate’s Subject Alternative Name list, and a certificate warning if you open the raw IP in a browser.

The vault itself was fine. Chromium add-ons check the certificate on their own. Clicking through a warning in a normal browser tab does not fix the add-on.

Use one hostname everywhere

  1. Make the hostname resolve through private DNS, split DNS, or the mesh VPN’s DNS.
  2. Issue a certificate whose Subject Alternative Name includes that hostname.
  3. Trust the issuing CA on every Bitwarden client.
  4. Set the Bitwarden add-on’s self-hosted URL to that same https:// address.

For a private CA with mkcert:

mkcert -install
mkcert -cert-file vaultwarden.crt \
  -key-file vaultwarden.key \
  vault.example.internal SERVER_IP VPN_IP
chmod 600 vaultwarden.key

Warning: install only the CA certificate on client devices. Never copy the CA private key to them. If a copy gets out, delete that copy and issue a new CA. A platform that already gives you trusted HTTPS certificates and private DNS is a better fit. Use its reverse proxy or certificate steps instead of a private CA.

  1. From each network path the clients use, confirm the name resolves and HTTPS checks out. Then sign in with that same URL:
getent hosts vault.example.internal
curl -fsS https://vault.example.internal/ >/dev/null \
  && echo "HTTPS validation succeeded"

If it doesn’t work

Official sources

Spot something wrong or outdated? Leave a comment below. Every comment is reviewed to keep these posts accurate.

By commenting, you agree to our Terms of use and confirm this is your own work. Short quotes are fine with a credit and link. Copied, unsafe, or abusive comments are removed. See something copied? Say so here.