---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/sessions/ca-certificates
markdown_url: https://steel.dev/docs/sessions/ca-certificates.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Trust custom CA certificates
description: Make a session trust a private certificate authority with the caCertificates option, so sites with certificates that it signs load in the browser.
summary: Make a session trust a private certificate authority with the caCertificates option, so sites with certificates that it signs load in the browser.
type: how-to
stage: experimental
reviewed: 2026-11-26
prerequisites:
  - https://steel.dev/docs/sessions/lifecycle.md
related:
  - https://steel.dev/docs/sessions/devices.md
  - https://steel.dev/docs/sessions/metadata.md
  - https://steel.dev/docs/sessions/bandwidth.md
  - https://steel.dev/docs/sessions/files.md
  - https://steel.dev/docs/sessions/extensions.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# Trust custom CA certificates

A site with a certificate from a private certificate authority (CA) does not load in a session, because the browser does not trust that CA. Internal sites and test servers often use such certificates. The same thing happens when a proxy inspects HTTPS traffic and signs it with its own CA.

Pass the CA's certificate in `caCertificates` when you create the session, and the browser trusts it for that session.

> **Note**
>
> `caCertificates` is Experimental. It can change without notice. See [Release stages](https://steel.dev/docs/platform/release-stages).

## Before you begin

Put your Steel API key in the `STEEL_API_KEY` environment variable, and install the Steel SDK for your language: [TypeScript](https://steel.dev/docs/reference/sdks/typescript#install), [Python](https://steel.dev/docs/reference/sdks/python#install), [Go](https://steel.dev/docs/reference/sdks/go#install) or [Rust](https://steel.dev/docs/reference/sdks/rust#install).

You also need the root certificate of the CA, in PEM format. The examples read it from a file named `ca.pem`.

## Pass the CA certificates

Set `caCertificates` to a list of certificates. Each item is one root CA certificate in PEM format, the text that starts with `-----BEGIN CERTIFICATE-----`.

**TypeScript**

```ts
import { readFileSync } from "node:fs";

const session = await client.sessions.create({
  caCertificates: [readFileSync("ca.pem", "utf8")],
});
```

**Python**

```python
from pathlib import Path

session = client.sessions.create(
    ca_certificates=[Path("ca.pem").read_text()],
)
```

**Go**

```go
import "os"

ca, err := os.ReadFile("ca.pem")
if err != nil {
	return err
}
session, err := client.Sessions.New(ctx, steel.SessionNewParams{
	CaCertificates: steel.F([]string{string(ca)}),
})
if err != nil {
	return err
}
```

**Rust**

```rust
let session = client
    .sessions()
    .create(steel_rs::SessionCreateParams {
        ca_certificates: Some(vec![std::fs::read_to_string("ca.pem")?]),
        ..Default::default()
    })
    .await?;
```

To trust more than one CA, add one item for each certificate.

If you [bring your own proxy](https://steel.dev/docs/stealth/proxies#bring-your-own-proxy) and it inspects HTTPS traffic, pass its CA certificate in `caCertificates` and its URL in `proxyUrl` in the same request.

## Check that it worked

Open a page of the site in the session, and watch it in the [live view](https://steel.dev/docs/observability/live-view). The page loads, and the browser shows no certificate warning.

## Troubleshooting

### `net::ERR_CERT_AUTHORITY_INVALID`

```text nocopy
page.goto: net::ERR_CERT_AUTHORITY_INVALID at https://internal.example.com/
```

**Cause:** The browser does not trust the CA that signed the site's certificate. The session has no `caCertificates`, or it has a certificate from a different CA.

**Fix:** Create a new session with the root certificate of the CA that signed the site's certificate, in PEM format, in `caCertificates`.

**Verify:** Open the page again. It loads without the error.

## Next steps

- [Session configuration](https://steel.dev/docs/sessions/configuration): See every option that you can set when you create a session.
- [Proxies](https://steel.dev/docs/stealth/proxies): Route a session through Steel's proxies or your own.
