Skip to content

Docs: note that Bun resources don't trust the dev cert via NODE_EXTRA_CA_CERTS (upstream Bun bug) #1802

Open

Description

Problem

Aspire sets up development certificate trust for the various resource types, but for Bun resources (AddBunApp/addBunApp), that doesn't actually work today. Aspire configures NODE_EXTRA_CA_CERTS (and SSL_CERT_DIR) on Bun resources automatically, pointing at the generated dev cert. Confirmed by inspecting the actual running process's environment. But Bun's fetch() still rejects the certificate with:

TypeError: unable to verify the first certificate
  code: "UNABLE_TO_VERIFY_LEAF_SIGNATURE"

This is a genuine Bun bug, not an Aspire misconfiguration: Bun doesn't trust a pinned self-signed leaf certificate with basicConstraints: CA:FALSE via NODE_EXTRA_CA_CERTS, even though Node.js does for the exact same certificate and env var. I filed and reproduced this upstream with a minimal, Aspire-independent repro: oven-sh/bun#44365.

Net effect: any Bun-hosted resource (e.g. a CopilotKit/AG-UI runtime bridge, or any custom Bun service) that calls another Aspire project resource over HTTPS in local development will fail with UNABLE_TO_VERIFY_LEAF_SIGNATURE out of the box, with no Aspire-side configuration able to fix it. The only current workaround is to call the target resource's plain-HTTP endpoint instead of HTTPS for that specific call.

Request

Please add a note to the relevant docs pages so other users don't lose time rediscovering this:

Activity

  1. Webmekanic commented on Oct 9, 2026

    @Webmekanic
    Contributor

    Hans Bakker (@hansmbakker) David Pine (@IEvangelist) Is this issue open for contribution? I would be glad to step in

  2. IEvangelist commented on Oct 13, 2026

    @IEvangelist
    Member

    Hi David Aniebo (@Webmekanic) - for sure, we're always open for contributions!

  3. hansmbakker commented on Oct 14, 2026

    @hansmbakker
    Author

    Please note that it is fixed upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions