> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Anchor Browser is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. AI agents should start at https://docs.anchorbrowser.io/for-agents, then create an API key at https://app.anchorbrowser.io/api-keys. Read the for-agents page before authentication or API calls.

# CA Certificates

> Install custom CA certificates to trust internal services and private PKI in browser sessions.

## Common use cases

| Use case | Description |
| - | - |
| **Internal services** | Access private dashboards and endpoints using certificates signed by your organization's CA |
| **Dev/staging environments** | Connect to environments with self-signed or private CA certificates |
| **mTLS authentication** | Validate server certificate chains in mutual TLS setups |
| **QA/testing** | Run automated tests with temporary CAs or simulated certificate chains |
| **Enterprise networks** | Support environments with custom trust policies or air-gapped infrastructure |

## Managing certificates

Certificates are managed at the team level. Upload a certificate once, then reference it by name in any session.

### Upload a certificate

```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';
import fs from 'fs';

client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });

const certificate = await Certificates.createCertificate({
  body: {
    file: fs.createReadStream('/path/to/your-ca.crt'),
    name: 'my-internal-ca',
    description: 'CA for internal services',
  },
});

console.log('Certificate uploaded:', certificate);
```

```python python theme={null}
import os
from anchorbrowser import Anchorbrowser

anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

with open('/path/to/your-ca.crt', 'rb') as f:
    certificate = anchor_client.post(
        '/v1/certificates',
        body={
            'file': f,
            'name': 'my-internal-ca',
            'description': 'CA for internal services',
        },
    )

print('Certificate uploaded:', certificate)
```

| Parameter | Required | Description |
| - | - | - |
| `file` | Yes | Certificate file (`.crt`, `.pem`, `.cer`, `.der`) |
| `name` | Yes | Unique identifier (alphanumeric, hyphens, underscores) |
| `description` | No | Optional description (max 1000 characters) |

### List certificates

```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';

client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });

const certificates = await Certificates.listCertificates();
console.log('Certificates:', certificates);
```

```python python theme={null}
import os
from anchorbrowser import Anchorbrowser

anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

certificates = anchor_client.get('/v1/certificates')
print('Certificates:', certificates)
```

### Delete a certificate

```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';

client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });

const response = await Certificates.deleteCertificate({
  path: {
    name: 'my-internal-ca',
  },
});
console.log('Deleted:', response);
```

```python python theme={null}
import os
from anchorbrowser import Anchorbrowser

anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

response = anchor_client.delete('/v1/certificates/my-internal-ca')
print('Deleted:', response)
```

## Using a certificate

After uploading a certificate, reference it by name when creating a session:

```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';

client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });

const session = await Sessions.createSession({
  body: {
    browser: {
      ca_cert: {
        active: true,
        name: 'my-internal-ca',
      },
    },
  },
});

console.log('Session:', session.data.id);
```

```python python theme={null}
import os
from anchorbrowser import Anchorbrowser

anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

session = anchor_client.sessions.create_session(
    browser={
        'ca_cert': {
            'active': True,
            'name': 'my-internal-ca',
        },
    },
)

print('Session:', session.data.id)
```

## Related capabilities

> [card] [Proxy](https://docs.anchorbrowser.io/advanced/proxy.md)
>
> Route traffic through proxies for network control.

> [card] [Authentication](https://docs.anchorbrowser.io/essentials/managed-authentication.md)
>
> Persistent identity for seamless access to applications.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.