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.
Complete the steps in Set up to configure your environment variables:
LATTICE_ENDPOINT, LATTICE_CLIENT_ID, and LATTICE_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_VERIFY environment variable:
If you are using gRPC with client credentials, set up the token refresh module before running the examples on this page.
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:
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:
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 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.