forwardemail / forwardemail/supertest

Self signed certificate issue

Open
#737 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

Hello everyone and thank you for reading.
I'm testing an API (Internal) that calls another API (external), and processes the results.
When I test methods that don't use the external, everything is fine.
When I call it via postman, the problematic method it works perfectly.
But, when I call it via SuperTest I get
```
Error: self signed certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34)
at TLSSocket.emit (events.js:400:28)
at TLSSocket._finishInit (_tls_wrap.js:936:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12) {
code: 'DEPTH_ZERO_SELF_SIGNED_CERT',
```
I've tried setting
`process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';`
and
```
"jest": {
"testEnvironment": "node"
}
```
without success.

Any ideas? I don't know what to do next.

Thank you all again.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.