> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/guides/development/using-certificates-in-processes.md).

# Using certificates in Processes

ACME enabled automatic handling of certificates.

Certificate lifetimes keep getting shorter. What used to be a yearly chore is now a quarterly one, and with Let's Encrypt moving toward 45-day certificates it is heading toward a monthly one. Frends 6.4 introduces managed certificates to take that burden off your shoulders: you can upload a certificate yourself, or let Frends obtain and renew it for you through the ACME protocol.

## Prerequisites

Before you start, make sure your environment is ready. You need Frends 6.4 or later, and the Agents in the target Agent Group must also run 6.4 or later, because a Process compiled against the new runtime will not start on older Agents.

You also need at least one active certificate in the Agent Group your Process runs in. How to upload or issue one is covered in the guide on enabling ACME and certificates.

## Setting up certificates

This guide assumes your certificates are already in place. Before a Process can reference a certificate, it has to exist as a managed certificate in the Agent Group, whether you uploaded it or issued it through ACME. That setup — enabling ACME, creating accounts and orders, uploading certificates, and activating and distributing them — is covered in the dedicated guide on enabling ACME and certificates.

Follow that guide first to get at least one active certificate into the Agent Group your Process runs in. The name you give the certificate there is the name you will reference here, so it is worth choosing a friendly, stable name up front. Once the certificate is active and distributed, come back to this guide to reference it from your Process.

## Referencing a certificate in a Process

Once a certificate is active in the Agent Group, a Process can reference it by name using the `#cert` syntax, in the same spirit as `#env` references. The general form is `#cert.<name>.<property>`, and the reference is resolved on the Agent when the Process starts, so tasks can load the certificate from the store by thumbprint without hard-coding a value that changes on every rotation.

The available properties are listed below. No key material is ever exposed; tasks use the thumbprint together with the store.

<table data-search="false"><thead><tr><th>Property</th><th>What it provides</th></tr></thead><tbody><tr><td><code>name</code></td><td>The certificate's name</td></tr><tr><td><code>thumbprint</code></td><td>The certificate thumbprint</td></tr><tr><td><code>subject</code></td><td>The certificate subject</td></tr><tr><td><code>issuer</code></td><td>The certificate issuer</td></tr><tr><td><code>notBefore</code></td><td>The start of the validity period</td></tr><tr><td><code>notAfter</code></td><td>The end of the validity period</td></tr><tr><td><code>purpose</code></td><td>The certificate purpose</td></tr><tr><td><code>storeName</code></td><td>The store name, <code>My</code></td></tr><tr><td><code>storeLocation</code></td><td>The store location, <code>CurrentUser</code></td></tr><tr><td><code>hasPrivateKey</code></td><td>Whether the certificate carries a private key</td></tr></tbody></table>

References are case-insensitive, like `#env`. If the name is not available on the Agent, the Process fails at the reference with the message `Certificate '<name>' is not available on this agent`.

A typical reference in a task parameter or expression looks like this:

```
#cert.clientauth_test.thumbprint
```

You can also combine it with surrounding text, for example when building a header value:

```
Bearer #cert.clientauth_test.thumbprint
```

<figure><img src="https://4223974572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0p415NUmUmiF4ayjI81L%2Fuploads%2FYek0kHDxDViNq0QGpzZM%2Fimage.png?alt=media&amp;token=a33395d5-9a73-4b75-a5d7-91a25ed86122" alt=""><figcaption><p>Auto-complete options for certificates.</p></figcaption></figure>

## Validation during Process development and deployment

Frends validates certificate references so problems surface before a Process reaches production. At deployment, the referenced names must exist as active, group-scoped certificates in the target Agent Group. If they do not, deployment is blocked and the error names both the Agent Group and the missing certificates, so you know exactly what to upload and activate. This check is skipped for the Development version switch, just like environment variables.

The Process editor helps you get the reference right in the first place. Typing `#cert.` suggests the certificate names available in the Agent Group, and after a known name it suggests the valid properties, so an unknown name or property is flagged before you deploy.

## Rotating and renewing certificates

The point of referencing certificates by name is that rotation becomes invisible to your Processes. Because `#cert.<name>.<property>` resolves at run time on the Agent, you never hard-code a thumbprint, and the Process keeps working across rotations.

Rotation happens under the same certificate name, so the reference stays valid and the Process does not need to be redeployed.

If the certificate is renewed through ACME, the renewal is activated and distributed automatically, and your Processes pick it up on their next run without a change on your side.

## Example: a client-authentication certificate in a Process

Suppose a partner requires mutual TLS and has issued you a client certificate. You upload it under the name `partner_mtls` with the purpose `ClientAuthentication`, activate it, and it is distributed to the Agent Group. In the task that calls the partner's endpoint, you point the client certificate thumbprint at `#cert.partner_mtls.thumbprint` instead of a literal value.

When the partner rotates the certificate, you upload the new file under the same name `partner_mtls` and activate it. The Process does not change, and the next execution resolves the new thumbprint on the Agent. If the certificate were issued through ACME instead, the renewal would happen automatically and the same reference would simply keep resolving to the current certificate.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.frends.com/guides/development/using-certificates-in-processes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
