Skip to content

SSL certificate rejected, OK on Browser #25109

@davidebaldini

Description

@davidebaldini

This testcase produces: err: Error: unable to verify the first certificate

"use strict";

const request = require("request");

(() => {
    request({
        url: "https://www.opl.co.il/",
        method: 'GET',
        timeout: 30000,
    }, function (err, res) {
        console.log("res: " + res);
        console.log("err: " + err);
    });
})();

I also tried with this, with the same outcome:

"use strict";

const request    = require("request"),
      syswidecas = require("syswide-cas"),
      sslRootCAs = require("ssl-root-cas/latest");

(() => {
    // add SSL certificates
    sslRootCAs.inject();
    syswidecas.addCAs("/etc/ssl/certs/");

    request({
        url: "https://www.opl.co.il/",
        method: 'GET',
        timeout: 30000,
    }, function (err, res) {
        console.log("res: " + res);
        console.log("err: " + err);
    });
})();

Firefox recognizes fine the SSL certificate of https://www.opl.co.il/; the great majority of other websites I tried work fine with both scripts above.

Environment:

nodejs v8.11.2
Debian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions