GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — npm does not respect strict-ssl and cafile · Issue #7226 · npm/npm

This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

npm does not respect strict-ssl and cafile #7226

Copy link
Copy link
Closed
Closed
npm does not respect strict-ssl and cafile#7226
Copy link
Labels
bug

Description

@madbence
madbence
opened on Jan 27, 2015
Issue body actions

npm does not respects strict-ssl and cafile (I'm using a custom registry):

$ npm -v
2.3.0
$ node -v
v0.10.36
$ npm i [pkg] # fails, because the custom ca is not in the built-in list
$ npm i [pkg] --strict-ssl false
npm info retry will retry, error on last attempt: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
$ npm i [pkg] --cafile /path/to/pem
npm info retry will retry, error on last attempt: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE

If I use the native https module, it works just fine:

require('https').get({ host: '...', rejectUnauthorized: false});
// or
require('https').get({ host: '...', ca: [require('fs').readFileSync('/path/to/pem')] })

Workarounds

  • It works under node v0.11.15 as expected
  • It works if I run npm with NODE_TLS_REJECT_UNAUTHORIZED=0 and --strict-ssl false

Activity

  1. smikes commented on Jan 28, 2015

    @smikes
    smikes
    on Jan 28, 2015
    Contributor
    More actions

    Thanks for the bug report. Since this works under node 0.11 and not 0.10, can you narrow down the failure to something in npm, or is it possible that it's node that is failing?

  2. madbence commented on Jan 28, 2015

    @madbence
    madbence
    on Jan 28, 2015
    Author
    More actions

    I guess it's something with npm or request.

    I've patched node_modules/request/request.js with reqOptions.agent = false, and it works, so the problem is caused by a custom agent (reqOptions.agent = undefined also works, so globalAgent is fine).

    It's weird, because it works under node v0.11

  3. madbence commented on Jan 28, 2015

    @madbence
    madbence
    on Jan 28, 2015
    Author
    More actions

    Ok, the root of the problem is afaik npm-registry-client, which creates an agent without rejectUnauthorized: false, so rejectUnauthorized: false in the request params is silently ignored.

  4. othiym23
    added
    bug
    next-patch
    on Jan 29, 2015
  5. othiym23 commented on Jan 29, 2015

    @othiym23
    othiym23
    on Jan 29, 2015
    Contributor
    More actions

    A bunch of people have noticed this regression, and it seems that we've broken --no-proxy as well over the last couple months. I'm going to try to get all of these addressed and into a 2.4.2 that I can sneak out the door alongside 2.5.0.

  6. othiym23
    closed this as completedin f9313a0on Jan 30, 2015
  7. madbence commented on Jan 30, 2015

    @madbence
    madbence
    on Jan 30, 2015
    Author
    More actions

    Awesome! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.