Skip to content

ng update ignores strict-ssl configuration #10596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
readme42 opened this issue May 2, 2018 · 7 comments
Closed

ng update ignores strict-ssl configuration #10596

readme42 opened this issue May 2, 2018 · 7 comments

Comments

@readme42
Copy link

readme42 commented May 2, 2018

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
@m00k
Copy link

m00k commented May 14, 2018

Would be useful to respect cafile property as well.

@readme42
Copy link
Author

Thanks a lot :)

@JonasGroeger
Copy link

Which version will this be included in?

@tabinnorway
Copy link

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.

@CSchulz
Copy link

CSchulz commented Jul 31, 2018

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.

@elclanrs
Copy link

elclanrs commented Aug 3, 2018

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

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants