Skip to content

Cannot connect to instances with system store trusted certificates #16

@rolodato

Description

@rolodato

mb cannot to connect to Metabase instances with certificates that are not trusted by Node.js by default.

The example below shows trying to connect to a local OrbStack container:

❯ mb auth login
│
◇  Profile name
│  default
│
◇  Metabase URL
│  https://metabase-62.metabase-compose.orb.local
│
◇  API key
│  •••••••••••••••••••
verification failed (/api/user/current): Could not reach Metabase: TLS error contacting metabase-62.metabase-compose.orb.local (SELF_SIGNED_CERT_IN_CHAIN) — the certificate could not be verified, or https:// was used against a plain-HTTP server. — credentials were not saved for profile "default"

As a workaround, run mb using NODE_USE_SYSTEM_CA=1:

❯ NODE_USE_SYSTEM_CA=1 mb auth login
│
◇  Profile name
│  default
│
◇  Metabase URL
│  https://metabase-62.metabase-compose.orb.local
│
◇  API key
│  •••••••••••••••••••
Logged in to https://metabase-62.metabase-compose.orb.local as Admin API Key (Admin). Saved to profile "default".

This can also happen in enterprise networks: https://nodejs.org/learn/http/enterprise-network-configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions