Skip to content

ng update ignores strict-ssl configuration #10596

Closed

Description

@readme42

When using a .npmrc file which contains

registry=myCustomRegistry
strict-ssl=false

for self signed certificates, ng update @angular/cli ignores the strict-ssl config and prints out
unable to verify the first certificate and aborts.

Angular CLI: 6.0.0-rc.9
Node: 10.0.0
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.12
@angular-devkit/build-angular     0.5.12
@angular-devkit/build-optimizer   0.5.12
@angular-devkit/core              0.5.12
@angular-devkit/schematics        0.5.12
@angular/cli                      6.0.0-rc.9
@ngtools/webpack                  1.10.2
@schematics/angular               0.5.12
@schematics/update                0.5.12
rxjs                              5.5.10
typescript                        2.6.2
webpack                           4.6.0

Activity

  1. m00k commented on May 14, 2018

    @m00k

    Would be useful to respect cafile property as well.

  2. readme42 commented on May 14, 2018

    @readme42
    Author

    Thanks a lot :)

  3. added a commit that references this issue on Jun 5, 2018
    9859277
  4. added 2 commits that reference this issue on Jun 6, 2018
    1972a50
    551c707
  5. JonasGroeger commented on Jun 25, 2018

    @JonasGroeger

    Which version will this be included in?

  6. tabinnorway commented on Jul 31, 2018

    @tabinnorway

    Hello? 6.1.1 and this is still an issue. There are no alternative ways of getting this to work at the moment, which means that we're going to have to drop angular soon.

  7. CSchulz commented on Jul 31, 2018

    @CSchulz

    It seems that there is a regression with 6.1.X. npm update worked for me in 6.0.8, but with 6.1.1 not any longer.

  8. elclanrs commented on Aug 3, 2018

    @elclanrs

    I tracked the issue down to schematics/update/update/npm.ts#L125-L139.

    Looks like strictSsl is actually a boolean and not a string so the if statements below won't do anything. I changed the code to this in the compiled output and it works now:

    function getNpmClientSslOptions(strictSsl, cafile) {
        const sslOptions = {};
        sslOptions.strict = strictSsl;
        if (cafile) {
            sslOptions.ca = fs_1.readFileSync(cafile);
        }
        return sslOptions;
    }

    In addition, I also had to manually pass my registry even though I have it set in my environment as npm_config_registry, so I did the following after the fix above to update:

    ng update --all --registry=$npm_config_registry
  9. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Sep 8, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions