Skip to content

[Feature] Support for system certificate store #7073

@mungojam

Description

@mungojam
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

When running yarn or yarn install to bring packages down in a corporate environment with proxy certificates, we generally get the common error about self-signed certificates. We end up setting NODE_EXTRA_CA_CERTS on all developer machines as a workaround but it means extra maintenance because sometimes the internal certificates get renewed, perhaps more often once the browser certificate lifetimes reduce.

Describe the solution you'd like

I understand from elsewhere that since Node.js v22.15.0 one can use this to pick up the system certs:

import { globalAgent } from 'https'
import { getCACertificates } from 'node:tls'

globalAgent.options.ca = getCACertificates('system')

I'd like it if this was automatically implemented where the node version was high enough.

Describe the drawbacks of your solution

Some code complexity with the version check, not aware of any other downsides.

Describe alternatives you've considered

The alternative is to continue using NODE_EXTRA_CA_CERTS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions