Configure mutual TLS (mTLS) for HTTP based data sources

This section describes how to configure mutual TLS (mTLS) for HTTP based data sources, like GraphQL, Apollo Federation, REST / OpenAPI and more.

Example Configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// wundergraph.config.ts
const spaceX = introspect.graphql({
apiNamespace: 'spacex',
url: 'https://localhost:8443',
mTLS: {
key: new EnvironmentVariable('KEY'),
cert: new EnvironmentVariable('CERT'),
insecureSkipVerify: true,
},
});
configureWunderGraphApplication({
apis: [spaceX],
});

To enable mTLS, add the mTLS property to the api configuration. Define the key and cert properties to the mTLS property. If the certificate of the server is self-signed, you should set the insecureSkipVerify property to true.

This example makes use of the EnvironmentVariable class, which is the recommended way to use environment variables when configuring WunderGraph.

Was this article helpful to you?
Provide feedback

Edit this page