Skip to content

node:tls does not implement setDefaultCACertificates #24340

@davidebombelli

Description

@davidebombelli

What version of Bun is running?

1.3.1+89fa0f343

What platform is your computer?

Linux 6.8.0-86-generic x86_64 x86_64

What steps can reproduce the bug?

  1. create a file test.mjs with the following content
import tls from 'node:tls';
import fs from 'node:fs';

const certs = [fs.readFileSync('./certificate.pem', 'utf8')];
tls.setDefaultCACertificates(certs);
  1. run it like bun test.mjs

What is the expected behavior?

No output should be given, but the file ./certificate.pem should be added to the default CA certificates.

What do you see instead?

TypeError: tls.setDefaultCACertificates is not a function. (In 'tls.setDefaultCACertificates(certs)', 'tls.setDefaultCACertificates' is undefined)
      at loadAndEvaluateModule (2:1)

Additional information

The easier example for this bug is:

import tls from 'node:tls';
tls.setDefaultCACertificates(tls.getCACertificates('system'));

But the method tls.getCACertificates is not implemented, as reported in #24339 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmed bugWe can reproduce this issuenice-reproAn unusually helpful reproduction is providednode:tls

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions