Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apollo server RESTDataSource - accept self signed certificates

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?

like image 995
John Rix Avatar asked Jul 01 '26 22:07

John Rix


1 Answers

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.

like image 116
John Rix Avatar answered Jul 04 '26 05:07

John Rix