Connect to offline environments
By default, the Lattice SDK validates TLS certificates to ensure a secure connection.
If the Lattice environment you are integrating with does not have access to the internet and you are connecting to it on a local network, you can use self-signed certificates.
This guide explains how to configure the SDK to use self-signed certificates.
Before you begin
-
Complete the steps in Set up to configure your environment variables:
LATTICE_ENDPOINT,LATTICE_CLIENT_ID, andLATTICE_CLIENT_SECRET. -
Verify that you have access to your Lattice environment and can connect to it. If you cannot access the environment, contact your Anduril representative for help.
-
Set a
SKIP_TLS_VERIFYenvironment variable:
gRPC authentication
If you are using gRPC with client credentials, set up the token refresh module before running the examples on this page.
Configure your client
By default, the SDK validates certificates against the system’s trusted Certificate Authority (CA) store.
This is the recommended configuration for any non-development environment. In development environments where CA infrastructure is not accessible, configure a custom HTTP client to accept self-signed certificates:
Initialize the client
Import your environment variables and Initialize the client. In the following, SKIP_TLS_VERIFY is a boolean set up as an environment
variable. You can achieve the same result using a local .env file, as well:
Create a custom client
Configure the HTTP client to set the InsecureSkipVerify option. This specifies whether the Lattice client skips verification,
and enables you to use self-signed certificates. If enabled, Lattice still performs basic validation of the certificate’s hostname,
and its expiry date.
Use the client
Use the client to call the Lattice API. In the following, we use GetEntity
to fetch an entity using its entityId:
When you need to connect to a offline environment, you set the SKIP_TLS_VERIFY to true and enable your integration
to use self-signed certificates.
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.