kevva / download

Download and extract files
MIT License
1.28k stars 200 forks source link

How to ignore "RequestError: self signed certificate" #148

Closed suryaval closed 6 years ago

suryaval commented 6 years ago
return download(someURL).then(function (data) {
            fs.writeFileSync(testDataDirectory + "/" + _this.uri, data);
            if (!data) {
                return false;
            }
            else {
                return true;
            }
        });

This is giving me "RequestError: self signed certificate"

suryaval commented 6 years ago

Never mind used options similar to request-promise and it worked out:

var options = {insecure: true,rejectUnauthorized: false}
return download(someURL,"",options).then(function (data) {
            fs.writeFileSync(testDataDirectory + "/" + _this.uri, data);
            if (!data) {
                return false;
            }
            else {
                return true;
            }
        });