Connect to offline environments
By default, the Lattice SDK validates TLS certificates against your operating system’s trusted Certificate Authority (CA) store.
When your Lattice environment is offline or air-gapped, it’s deployed on a local network without access to a public CA infrastructure. The environment presents a certificate signed by a private Anduril CA that isn’t in your system’s trust store, so your SDK client can’t validate it and the connection fails.
This guide describes two ways to connect:
- Use an Anduril-issued certificate: This method lets the SDK trust your environment while keeping full TLS verification enabled. This is the recommended approach in production.
- Skip TLS verification with self-signed certificates: This method lets you connect when an Anduril representative can’t issue a certificate. Use this approach only in development environments.
Before you begin
- Complete the steps in Install to create your project and its reusable
client, and to set the
LATTICE_ENDPOINT,ENVIRONMENT_TOKEN, andSANDBOXES_TOKENenvironment variables. The examples on this page start from that client and change only how it handles TLS.
These gRPC examples authenticate with a static environment token attached as request metadata. If you are using OAuth 2.0 client credentials instead, set up the token refresh module before running the examples on this page.
Use an Anduril-issued certificate
This is the recommended approach because it keeps full TLS verification enabled. You obtain a CA certificate from Anduril, add it to your trust store, and configure the SDK to trust it as a root CA. The SDK still validates the certificate chain, hostname, and expiry date.
To obtain the certificate, add it to your trust store, and configure the SDK to trust it, follow these steps:
Get the Anduril-issued certificate
Contact your Anduril representative to obtain the CA certificate for your Lattice environment. The certificate is delivered as a PEM-encoded file. Because delivery mechanisms vary, follow the instructions your Anduril representative provides to retrieve it.
Add the certificate to the system's trust store
Add the certificate to your operating system’s trust store so that clients on your machine trust it:
Set an environment variable with the certificate path
Set a LATTICE_CA_CERT_PATH environment variable that points to the certificate file. The examples in the
following steps load the CA certificate from LATTICE_CA_CERT_PATH and configure the Lattice client to trust
it as a root CA:
Apply the certificate to the common client
Take the client from your project’s common module, and give it an HTTP or gRPC client that trusts the
Anduril-issued certificate. Each example loads the certificate from the PEM file at LATTICE_CA_CERT_PATH and
adds it to the trust pool, so the client verifies the server’s certificate against the Anduril CA during every
TLS handshake. If LATTICE_CA_CERT_PATH isn’t set, the client keeps using your system’s trust store. The
example then uses the client to fetch an entity with GetEntity:
After you add the CA certificate to your trust store and load it in your client, your integration can connect to an offline environment with full TLS verification enabled.
Skip TLS verification with self-signed certificates
If you can’t obtain an Anduril-issued certificate for a development environment, you can configure the SDK to skip TLS verification. The SDK then connects without validating the server’s certificate.
Skipping TLS verification disables certificate validation, which exposes your connection to interception and tampering. Use this approach only in development environments where an Anduril representative can’t issue an Anduril-issued certificate. In production, use an Anduril-issued certificate instead.
To skip TLS verification and configure your client, follow these steps:
Set an environment variable
Set a SKIP_TLS_VERIFY environment variable so the client knows to skip certificate validation. The examples
in the following steps read SKIP_TLS_VERIFY and configure a custom Lattice client that skips TLS
verification:
Skip TLS verification in the common client
Take the client from your project’s common module, and give it an HTTP or gRPC client that skips
certificate validation when SKIP_TLS_VERIFY is true. In Go, this uses the InsecureSkipVerify option;
the other languages provide an equivalent. The example then uses the client to fetch an entity with
GetEntity:
What’s next
- Learn how to publish entities to Lattice.
- Explore tasking to learn how you can task an agent in Lattice.
- Learn more about the Lattice OAuth 2.0 endpoint.