Skip to content

client-certificate-auth API Reference


client-certificate-auth API Reference / helpers / allowSAN

Function: allowSAN()

allowSAN(values): ValidationCallback

Defined in: helpers.js:176

Create a validation callback that allows certificates with matching Subject Alternative Names. Checks the subjectaltname field (format: "DNS:example.com, email:user@example.com").

Parameters

values

string[]

Allowed SAN values (e.g., "DNS:example.com", "example.com", "user@example.com")

Returns

ValidationCallback

Example

ts
app.use(clientCertificateAuth(allowSAN(['DNS:api.example.com', 'email:admin@example.com'])));

Released under the MIT License.