4

When implementing a RESTDataSource class for an Apollo server instance, how can I make it accept self signed certificates from my target REST API for development purposes?

I have process.env.NODE_TLS_REJECT_UNAUTHORIZEDset to 0 within my project, but this at least seems to have no impact.

Is there a rejectUnauthorised configuration option I can somehow set perhaps?

John Rix
  • 6,271
  • 5
  • 40
  • 46

1 Answers1

1

It proved to be a problem with my webpack configuration in the end, and a misunderstanding of how the webpack.DefinePlugin plugin works. With this corrected, setting process.env.NODE_TLS_REJECT_UNAUTHORIZED to "0" did in fact have the desired effect.

John Rix
  • 6,271
  • 5
  • 40
  • 46