question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng update ignores strict-ssl configuration

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

2reactions
JonasGroegercommented, Jun 25, 2018

Which version will this be included in?

1reaction
elclanrscommented, 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
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix SSL certificate error when running Npm on ...
npm config set strict-ssl false. solved the issue for me. In this case both my agent and artifact depository are behind a private...
Read more >
strict-ssl npmrc - You.com | The AI Search Engine ...
for self signed certificates, ng update @angular/cli ignores the strict-ssl config and prints out unable to verify the first certificate and aborts.
Read more >
Enable SSL certificate checking when using Print Deploy
Step 2: Enable the StrictSSLCheckingEnabled configuration key. To enable strict SSL checking, add or update the line StrictSSLCheckingEnabled = true in the ...
Read more >
ng update
Create source control commits for updates and migrations. Aliases: -C. boolean, false. --force. Ignore peer dependency version mismatches.
Read more >
Running Angular CLI over HTTPS with a Trusted Certificate
Enabling SSL. The Angular CLI provides us with three parameters we can pass along with the ng serve command to enable and configure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found