angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng update ignores strict-ssl configuration

Open readme42 opened this issue 8 years ago • 7 comments

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

readme42 avatar May 02 '18 11:05 readme42

Would be useful to respect cafile property as well.

m00k avatar May 14 '18 12:05 m00k

Thanks a lot :)

readme42 avatar May 14 '18 22:05 readme42

Which version will this be included in?

JonasGroeger avatar Jun 25 '18 13:06 JonasGroeger

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.

tabinnorway avatar Jul 31 '18 10:07 tabinnorway

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.

CSchulz avatar Jul 31 '18 11:07 CSchulz

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

elclanrs avatar Aug 03 '18 13:08 elclanrs

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.