---
title: Bun v1.1.45
description: "Fixes 13 bugs (addressing 50 👍) 82% of the 'streams' module tests from Node.js' test suite now pass in Bun. node:crypto now implements diffieHellman, getCipherInfo, and X509Certificate. The checkServerIdentity object now matches Node.js' format. Bugfixes in Bun's fs.mkdirSync method, importing with query string"
date: "2025-01-17T15:35:49.975Z"
author: jarred
---

{% callout %}
We're hiring [systems engineers](/careers) in San Francisco to build the future of JavaScript!
{% /callout %}

This release fixes 13 bugs (addressing 50 👍) and improves compatibility with Node.js. 82% of the 'streams' module tests from Node.js' test suite now pass in Bun. node:crypto now implements diffieHellman, getCipherInfo, and X509Certificate. The checkServerIdentity object now matches Node.js' format. Bugfixes in Bun's fs.mkdirSync method, importing with query strings.

#### To install Bun

{% codetabs %}

```sh#curl
$ curl -fsSL https://bun.sh/install | bash
```

```sh#npm
$ npm install -g bun
```

```sh#powershell
$ powershell -c "irm bun.sh/install.ps1|iex"
```

```sh#scoop
$ scoop install bun
```

```sh#brew
$ brew tap oven-sh/bun
$ brew install bun
```

```sh#docker
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
```

{% /codetabs %}

#### To upgrade Bun

```sh
$ bun upgrade
```

## node:stream compatibility improvements

node:stream now passes 82% of Node.js' test suite. Several of the remaining test failures are testing Node.js internals that don't exist in Bun.

Thanks to [@nektro](https://github.com/nektro) for this!

## node:crypto improvements

### `X509Certificate`

This release implements `X509Certificate` in `node:crypto`.

```ts
import { X509Certificate } from "node:crypto";

// Create a new X.509 certificate from a string
const cert = new X509Certificate(
  "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
);

// Get the subject of the certificate
console.log(cert.subject); // Outputs the subject's distinguished name
```

Thanks to [@dylan-conway](https://github.com/dylan-conway) for this! And thanks to [@jasnell](https://github.com/jasnell) for the `ncrypt` wrapper library used by Bun, Cloudflare Workers, and Node.js.

### `diffieHellman`

The `diffieHellman` method is now implemented in `node:crypto`.

### `getCipherInfo`

The `getCipherInfo` method is now implemented in `node:crypto`.

### `Certificate`

The `Certificate` class with static methods `exportPublicKey`, `exportChallenge`, and `verifySpkac` is now implemented in `node:crypto`.

### checkServerIdentity fix

The X509 object returned by `checkServerIdentity` (used in node:http, node:tls, and also in `fetch`) now matches the format of the X509 object in Node.js. Some fields were strings in Bun and arrays of strings in Node.js, now they're arrays of strings in Bun as well.

### Fixed: memory leak involving X509 certificates in node:tls

A memory leak involving X509 certificates in node:tls has been fixed.

## Fixed: fs.mkdir recursive regression

A regression introduced in Bun v1.1.44 (while working on node:fs compatibility) caused `fs.mkdirSync` to throw an error when the target directory already exists. This commit fixes the regression.

```js
it("fs.mkdirSync recursive should not error when the directory already exists, but should error when its a file", () => {
  expect(() =>
    mkdirSync(import.meta.dir, { recursive: true }),
  ).not.toThrowError();
  expect(() => mkdirSync(import.meta.path, { recursive: true })).toThrowError();
});
```

## Fixed: hang when importing duplicate modules with ?query strings

A regression introduced in Bun v1.1.21 caused Bun to hang when importing modules with query strings in the URL. This commit fixes the regression.

```js
// This used to hang
import myModule from "./myModule.js";
import myModule2 from "./myModule.js?param=value";

// This did not hang
import myModule3 from "./myModule.js?param=value";
import myModule4 from "./myModule.js";
```

## Thanks to 5 contributors!

- [@jarred-sumner](https://github.com/jarred-sumner)
- [@nektro](https://github.com/nektro)
- [@rgarcia](https://github.com/rgarcia)
- [@riskymh](https://github.com/riskymh)
- [@zackradisic](https://github.com/zackradisic)
