> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/mom/planning/certificates.md).

# Certificates

MOM uses TLS on both ports, so it needs a certificate with a private key. Clients must trust that certificate before BITS will use MOM.

## Options

The option is **Certificate options** in the Configuration Editor.

| Option                     | When to use                                            | What clients need                            |
| -------------------------- | ------------------------------------------------------ | -------------------------------------------- |
| **AutoGenerate** (default) | Tests and small setups                                 | The MOM certificate imported on every client |
| **LocateBySubjectName**    | Production. A certificate from your PKI or a public CA | Nothing, if they trust the CA                |
| **LocateByThumbprint**     | The same, selected by thumbprint                       | Nothing, if they trust the CA                |

The name or IP address that clients use for MOM must be in the certificate as a subject alternative name (SAN). For the auto-generated certificate, these are the DNS name and the IP address you enter in the Configuration Editor.

## Auto-generated certificate

MOM creates the certificate the first time the service starts.

| Fact      | Value                                                                |
| --------- | -------------------------------------------------------------------- |
| Name      | `TwoPintSoftware MOM Root Certificate Authority`                     |
| Store     | Trusted Root Certification Authorities, local computer               |
| Valid for | One year                                                             |
| Needs     | A DNS name, an IP address and a URI, set in the Configuration Editor |

Do not copy `mom.crt` from the data folder to clients. It contains the private key. Export the certificate **without** the private key from `certlm.msc` on the MOM server and distribute that file. See [Configuring clients](https://documentation.2pintsoftware.com/mom/installation/configuring-clients.md).

To renew the certificate, or to change its names, see [Troubleshooting](https://documentation.2pintsoftware.com/mom/troubleshooting/overview.md#creating-a-new-auto-generated-certificate).

## Your own certificate

Install the certificate with its private key on the MOM server. MOM looks in **Trusted Root Certification Authorities** of the local computer by default. Another store can be set with **Certificate store location** and **Certificate store name**.

## HTTPS downloads

For a download from an HTTPS server, the client sees MOM's certificate in place of the server's, because MOM decrypts the download to keep a copy. The name in the certificate then does not match the server.

* The StifleR client sets its BITS jobs to accept this.
* For a BITS job you create yourself, run `bitsadmin /setsecurityflags <job> 30`.

## Certificate revocation (CRL)

A certificate from a CA has a revocation list (CRL). When BITS uses an `https://` proxy, Windows checks that list, but only in its local cache. If the list is not there, the BITS job fails with `0x80072F9C`.

The StifleR client solves this. Before it uses a MOM, it downloads the CRLs for MOM's certificate and stores them on the client. If it cannot, the job runs without MOM.

For this to work:

* The client must trust the CA that issued MOM's certificate.
* The client must be able to reach the CRL address in the certificate, over `http://` or `ldap://`.

| MOM certificate              | MOM used                               |
| ---------------------------- | -------------------------------------- |
| Trusted, CRL reachable       | Yes                                    |
| Trusted, CRL not reachable   | Only while a stored CRL is still valid |
| Not trusted                  | No                                     |
| Revoked                      | No                                     |
| Auto-generated               | Yes. It has no CRL                     |
| None (plain `http://` proxy) | Yes                                    |

To run the check by hand, elevated on a client:

```
StifleR.ClientApp.exe /MomCrl https://<mom>:8089
```

The check is on by default. The client setting is `MomCrlCheckEnabled`.

### Without the StifleR client

Add the CRLs of the CA to the client yourself, before the BITS job starts, and replace them before they expire:

```
certutil -addstore CA <file>.crl
```


---

# 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://documentation.2pintsoftware.com/mom/planning/certificates.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.
