Hi,
I am trying to implement apollo federation with multiple subgraphs. I am able to create supergraph and start the server locally, however getting “self signed certificate in certificate chain” error when issuing query. The subgraphs are protected with company authorization. Following is the main code for apollo gateway.
I tried setting NODE_TLS_REJECT_UNAUTHORIZED to false but doesn’t seem to have any effect.
Any suggestions on what I can do for the error?
const { ApolloServer } = require(‘apollo-server’);
const { ApolloGateway, RemoteGraphQLDataSource } = require(‘@apollo/gateway’);
const { readFileSync } = require(‘fs’);
const supergraphSdl = readFileSync(‘./supergraph.graphql’).toString();
class AuthenticatedDataSource extends RemoteGraphQLDataSource {
willSendRequest({ request, context }) {
//Sending hard coded token value for testing locally
return ‘Bearer’ +
}
}
const gateway = new ApolloGateway({
supergraphSdl,
buildService({ name, url }) {
return new AuthenticatedDataSource({ url });
},
subscriptions: false,
NODE_TLS_REJECT_UNAUTHORIZED: false
});
Thank You,
const server = new ApolloServer({
gateway
});
server.listen().then(({ url }) => {
console.log(🚀 Gateway ready at ${url}
);
}).catch(err => {console.error(err)});