# @ipshipyard/libp2p-auto-tls

> Automatically acquire a .libp2p.direct TLS certificate

Latest version **2.0.2** (published 2026-06-29) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install @ipshipyard/libp2p-auto-tls
pnpm add @ipshipyard/libp2p-auto-tls
yarn add @ipshipyard/libp2p-auto-tls
bun add @ipshipyard/libp2p-auto-tls
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-06-29 |
| First published | 2025-02-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 17 |
| Unpacked size | 98.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Maintainers | aschmahmann, achingbrain, ipshipyard-publisher-bot |

## Links

- npm: https://www.npmjs.com/package/@ipshipyard/libp2p-auto-tls
- Repository: https://github.com/ipshipyard/js-libp2p-auto-tls
- Homepage: https://github.com/ipshipyard/js-libp2p-auto-tls#readme
- Issues: https://github.com/ipshipyard/js-libp2p-auto-tls/issues
- npm.io page: https://npm.io/package/@ipshipyard/libp2p-auto-tls

## Dependencies (17)

- [delay](https://npm.io/package/delay.md) ^7.0.0
- [any-signal](https://npm.io/package/any-signal.md) ^4.1.1
- [acme-client](https://npm.io/package/acme-client.md) ^5.4.0
- [uint8arrays](https://npm.io/package/uint8arrays.md) ^6.1.1
- [@libp2p/http](https://npm.io/package/@libp2p/http.md) ^2.0.0
- [multiformats](https://npm.io/package/multiformats.md) ^14.0.2
- [@libp2p/utils](https://npm.io/package/@libp2p/utils.md) ^7.0.4
- [@libp2p/crypto](https://npm.io/package/@libp2p/crypto.md) ^5.0.9
- [@peculiar/x509](https://npm.io/package/@peculiar/x509.md) ^2.0.0
- [@chainsafe/is-ip](https://npm.io/package/@chainsafe/is-ip.md) ^2.0.2
- [@libp2p/keychain](https://npm.io/package/@libp2p/keychain.md) ^6.0.4
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.2.2
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^3.0.2
- [interface-datastore](https://npm.io/package/interface-datastore.md) ^10.0.1
- [@multiformats/multiaddr](https://npm.io/package/@multiformats/multiaddr.md) ^13.0.1
- [@libp2p/interface-internal](https://npm.io/package/@libp2p/interface-internal.md) ^3.0.4
- [@multiformats/multiaddr-matcher](https://npm.io/package/@multiformats/multiaddr-matcher.md) ^3.0.1

## Recent versions

- 2.0.2 (latest) — 2026-06-29
- 2.0.1 — 2025-10-03
- 2.0.0 — 2025-10-02
- 1.0.0 — 2025-02-10
- 0.0.0 — 2025-02-07

## README

# @ipshipyard/libp2p-auto-tls

[![codecov](https://img.shields.io/codecov/c/github/ipshipyard/js-libp2p-auto-tls.svg?style=flat-square)](https://codecov.io/gh/ipshipyard/js-libp2p-auto-tls)
[![CI](https://img.shields.io/github/actions/workflow/status/ipshipyard/js-libp2p-auto-tls/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipshipyard/js-libp2p-auto-tls/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> Automatically acquire a <peerId>.libp2p.direct TLS certificate

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

When a publicly dialable address is detected, use the p2p-forge service at
<https://registration.libp2p.direct> to acquire a valid Let's Encrypt-backed
TLS certificate, which the node can then use with the relevant transports.

The node must be configured with a listener for at least one of the following
transports:

TCP or WS or WSS, (along with the Yamux multiplexer and TLS or Noise encryption)
QUIC-v1
WebTransport

It also requires the Identify protocol.

## Example - Use UPnP to hole punch and auto-upgrade to Secure WebSockets

```TypeScript
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { autoTLS } from '@ipshipyard/libp2p-auto-tls'
import { autoNAT } from '@libp2p/autonat'
import { identify } from '@libp2p/identify'
import { keychain } from '@libp2p/keychain'
import { webSockets } from '@libp2p/websockets'
import { uPnPNAT } from '@libp2p/upnp-nat'
import { createLibp2p } from 'libp2p'

const node = await createLibp2p({
  addresses: {
    listen: [
      '/ip4/0.0.0.0/tcp/0/ws'
    ]
  },
  transports: [
    webSockets()
  ],
  connectionEncrypters: [
    noise()
  ],
  streamMuxers: [
    yamux()
  ],
  services: {
    autoNAT: autoNAT(),
    autoTLS: autoTLS(),
    identify: identify(),
    keychain: keychain(),
    upnp: uPnPNAT()
  }
})

// ...time passes

console.info(node.getMultiaddrs())
// includes public WSS address:
// [ '/ip4/123.123.123.123/tcp/12345/tls/ws' ]
```

# Install

```console
$ npm i @ipshipyard/libp2p-auto-tls
```

# API Docs

- <https://ipshipyard.github.io/js-libp2p-auto-tls>

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipshipyard/js-libp2p-auto-tls/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/ipshipyard/js-libp2p-auto-tls/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

---
_Source: https://npm.io/package/@ipshipyard/libp2p-auto-tls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
