# Let your VPN gateway check Trustaige device certificates

> Have any IKEv2 gateway admit managed devices by their Trustaige certificate, trusting your authorities and checking status over OCSP.

Source: https://docs.trustaige.com/manage/vpn-gateway-certificate

Replace these placeholders with your organization's own values:

- `<your-network-ca-id>`: Network authority ID, for example `3b8f6a1e-5c2d-4e7f-9a10-6d4c2b8e1f35`. The ID in the authority’s CRL address, under Your RADIUS server on the network’s page.

Some gateways can't pass EAP through to a RADIUS server, and a Windows device
tunnel connects before anyone signs in, when there is no one to sign in for.
For both, the gateway checks the device's certificate itself, as it would any
client certificate. Trustaige still issues and renews the certificate, and
still decides whether it is good: the gateway asks over OCSP, and Trustaige
answers from the device's standing.

1. Device → VPN gateway: IKEv2, signed with the device certificate’s hardware key
2. VPN gateway → Trustaige: chained to your authorities; OCSP: is it good?
3. Trustaige → VPN gateway: good, revoked, or on hold
4. VPN gateway → Device: tunnel up, or refused

Where your gateway can pass EAP through, prefer
[Trustaige RADIUS](/manage/vpn-gateway): it also checks the device's owner,
posture and your policies on every connection, and can disconnect a device in
seconds. The gateway's own check sees only what OCSP reports.

## Set up the VPN in the hub

1. Open **Devices › Networks**, choose **Add network**, and at **Kind**
   choose **VPN**. Enter the gateway, its certificate's authority and what the
   VPN carries, as [the overview](/manage/vpn-gateway#set-up-the-vpn-in-the-hub)
   describes.

2. At **Server**, choose **The gateway checks the certificate**.

3. Choose who may connect, review, and finish. At **Done**, choose **Set up
   your gateway**. The same page is on the network's page later, under **Your
   VPN gateway**: **Trust bundle, revocation and gateway guides**.

Nothing is registered at a site, and the gateway sends Trustaige no RADIUS.

## What the gateway needs

The **Your VPN gateway** page has:

| Section | What it holds | Where it goes |
|---|---|---|
| **Trust bundle** | Your organization's network authorities, every generation still in use, in one PEM file (**Download**), each with its OCSP and CRL addresses | The gateway's trusted CAs for client certificates |
| **Device certificates** | The fields every device certificate carries | Any rule the gateway applies to the certificate |
| **Revocation** | The current authority's OCSP and CRL addresses | The gateway's revocation check |
| Guides | strongSwan, FortiGate, MikroTik | Your engineer |

Each authority's addresses carry the ID shown in its CRL address:

| Address | What it serves |
|---|---|
| `https://id.trustaige.com/pki/ocsp/<your-network-ca-id>` | OCSP, by GET or POST |
| `https://id.trustaige.com/pki/crl/<your-network-ca-id>.crl` | The authority's CRL, in DER |
| `https://id.trustaige.com/pki/ca/<your-network-ca-id>.crt` | The authority's own certificate, in DER, for a gateway that imports one file per CA |

Every device certificate also names its authority's OCSP address, so a gateway
that reads it from the certificate needs nothing more.

## Trust your organization's authorities

Give the gateway the authorities in the trust bundle, and not the platform
root on its own. The platform root signs the authority of every organization
on Trustaige, so a gateway that trusts the root alone would admit another
organization's devices. Your authorities sign only your devices.

Each authority lasts two years. A new generation is introduced 30 days before
it signs anything, and every administrator is emailed when it is issued. Add
it to the gateway then; remove a retiring one only once **Certificates** shows
none of its certificates in use. [Rollover](/manage/own-radius-server#rollover)
has the detail.

## Check status by OCSP

The OCSP responder answers from each device's standing, the same facts
Trustaige RADIUS checks:

| The device | OCSP answer |
|---|---|
| Its certificate was revoked | `revoked`; final |
| Removed, blocked or deleted, in Lost Mode, or its owner's membership ended, expired or was suspended | `revoked`, reason `certificateHold`, lifted when that changes |
| Non-compliant, when **Report non-compliant devices as on hold** is on | `revoked`, reason `certificateHold` |
| Anything else | `good` |

A change reaches OCSP at once. An answer is valid for an hour, and may be
cached for up to 60 seconds; a request with a nonce gets a fresh answer every
time. When Trustaige can't read a device's standing, it answers `tryLater`,
not `good`. [Revocation and standing](/manage/own-radius-server#revocation-and-standing)
covers the CRL and the responder certificate.

> **Important:** Set the gateway to refuse a certificate whose status it can't get, and to treat
> `certificateHold` as a refusal. A gateway that soft-fails admits a revoked
> device whenever it can't reach Trustaige. The status addresses answer over
> HTTPS only.

## When a device loses its standing

The gateway asks about a certificate when a tunnel is set up, and again when
the tunnel re-authenticates:

- **A device that isn't connected** is refused at its next connection. The
  person sees the VPN fail to connect, and the device's page in the hub shows
  why.
- **A device that is connected** stays connected until the gateway
  re-authenticates the tunnel or checks the certificate again. Set the
  gateway's re-authentication interval to the longest you'll allow; each guide
  shows where.
- **When the standing returns**, the hold lifts at once, and the device
  connects again on its next try.

With Trustaige RADIUS deciding instead, a connected device can be disconnected
within seconds.

## The device certificate

Every device signs in with the certificate Trustaige issues for networks:
subject `CN=tq-` followed by the device ID, alternative name
`URI:urn:uuid:` followed by the device ID, extended key usage `clientAuth`, an
ECDSA P-256 key made in the device's hardware. The full shape is under
[The device certificate](/manage/own-radius-server#the-device-certificate).

Configure the gateway to admit a device by its certificate's chain, not by the
IKE identity it sends. Apple devices send `tq-` followed by the device ID,
which the certificate carries as its common name but not as an alternative
name, so a gateway that requires the identity among the certificate's
alternative names refuses them.

Give the gateway an ECDSA P-256 certificate of its own for this VPN: Apple
devices sign in with an ECDSA P-256 key here, and expect the gateway's key to
be of the same type.

## What devices receive

| Platform | Receives |
|---|---|
| Apple | An IKEv2 VPN that signs in with the device's certificate, on supervised iPhones, iPads and Macs. User Enrollment devices take per-app VPN only. |
| Windows | A device tunnel that connects before anyone signs in, with Warden's device certificate. Device tunnels need Windows Enterprise or Education; a Windows Pro PC can't take one. |
| Android | Android 11 and later connect through the strongSwan app, with the device's certificate. |

## Check it works

1. Connect from a managed device that has received the VPN. The gateway's log
   shows the certificate chain verified and an OCSP answer of `good`.
2. Block the device in the hub, disconnect it, and connect again. The gateway
   refuses it, logging the certificate as revoked.
3. Unblock the device. It connects again on its next try.

## Troubleshooting

**The gateway says the client certificate's issuer is unknown**

The gateway doesn't trust the authority that issued the device's certificate.
Download the trust bundle again and add every authority in it; during a
rollover there are two.

**Every device is refused once revocation checking is on**

The gateway can't reach `id.trustaige.com` over HTTPS on port 443, or doesn't
fetch status over HTTPS. Check its outbound access first, then the vendor
guide.

**Apple devices are refused, but Android devices connect**

The gateway compares the device's IKE identity with the certificate's
alternative names. Configure it to admit the device by its certificate chain;
each vendor guide shows how where the gateway allows it. Check also that the
gateway's own certificate holds an ECDSA P-256 key.

**A blocked device is still connected**

The gateway checks status only when the tunnel is set up or re-authenticated.
Shorten its re-authentication interval, or move the VPN to Trustaige RADIUS,
which disconnects within seconds.
