question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use supertest for self-sign certificate

See original GitHub issue

Hi guys,

We have a problem when run test, the result is ‘unable to verify the first certificate’, is there any built-in options on supertest to disable ssl certificate verification? just like rejectUnauthorized on request. We found many suggestions use process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 but it doesn’t work on us.

Thank you

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ktamaralcommented, Apr 14, 2020

Same here on Node 12 and supertest 4.0.2. trustLocalHost() no longer exists and setting process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 does not work.

0reactions
andre5scommented, Dec 2, 2022

Check here: #737

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use supertest for self-sign certificate · Issue #547 - GitHub
Hi guys, We have a problem when run test, the result is 'unable to verify the first certificate', is there any built-in options...
Read more >
node.js - NodeJS supertest - testing routes with certificates
On Node.js, TLS and HTTPS will validate certificates before accepting them. Therefore, to use self-signed certificates with Node, ...
Read more >
NodeJS HTTPS API testing with mocha and super test - Edureka
I need to use mocha and supertest to test an API that is provided over HTTPS (the certificate are not expired).
Read more >
Use supertest for self-sign certificate - Bountysource
Hi guys,. We have a problem when run test, the result is 'unable to verify the first certificate', is there any built-in options...
Read more >
Supertest Code Review - ISGroup
'Setting 'NODE_TLS_REJECT_UNAUTHORIZED' to 0 will allow node server to accept self signed certificates and is not an secure behaviour. 10, test/supertest.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found