---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / createTlsDispatcher

# Function: createTlsDispatcher()

> **createTlsDispatcher**(`options`): `Agent` \| `undefined`

Defined in: [packages/b2c-tooling-sdk/src/clients/tls-dispatcher.ts:96](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/tls-dispatcher.ts#L96)

Creates an undici Agent with custom TLS options for mTLS/self-signed cert support.

Returns undefined if no TLS options are needed (default fetch behavior).

## Parameters

### options

[`TlsOptions`](../interfaces/TlsOptions.md)

TLS configuration options

## Returns

`Agent` \| `undefined`

An undici Agent configured for TLS, or undefined if not needed

## Examples

```ts
// Client certificate authentication
const dispatcher = createTlsDispatcher({
  certificate: './my-cert.p12',
  passphrase: 'secret',
});
```

```ts
// Self-signed certificate support
const dispatcher = createTlsDispatcher({
  rejectUnauthorized: false,
});
```
