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.

ignore self signed certificate issue in request-promise

See original GitHub issue

I am using request-promise module for my node app to make some API call. https://www.npmjs.com/package/request-promise

import request from 'request-promise';
let options = {
                method: GET,
                json: true,
                uri : "https://" +this.urls + endpoint,
                body: payload,
                rejectUnauthorized: false // This doesn't work
            };

let response = await request(options)

SInce the API what I am trying to use is insecure (having self signed certificate), the conncetion is failing with this error:

Error: connect ECONNREFUSED I know with “request” module, we could pass rejectUnauthorized: false , to handle such case. I am not sure how can I pass such option with request-promise module.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

58reactions
Elyx0commented, Apr 9, 2018

Having the same issue, insecure true didn’t solve it but rejectUnauthorized: false did

27reactions
ecdevelopercommented, Sep 26, 2017

Add insecure: true to your options. So it looks like

let options = {
                method: GET,
                json: true,
                uri : "https://" +this.urls + endpoint,
                body: payload,
                insecure: true
            };
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to ignore self signed certificate issue in request-promise
SInce the API what I am trying to use is insecure (having self signed certificate), the conncetion is failing with this error:.
Read more >
Javascript – How to ignore self signed certificate issue in request ...
I am using request-promise module for my node app to make some API call. ... I know with "request" module, we could pass...
Read more >
How to Resolve Certificate Errors in a NodeJS App with SSL ...
Quick and Dirty Fix: rejectUnauthorized​​ The easiest solution to resolve these errors is to use the “rejectUnauthorized” option shown below. However, this ...
Read more >
request-promise - Bountysource
I follow Readme of this repo by use body(json key) but error message warning about "data is not define". And this is full...
Read more >
pg-promise self signed certificate error in Postgres
To fix this issue you have to use the package with the following recommendations ... If you are using Node.js with some of...
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