TSD Error: Self-Signed Certificate in Certificate Chain

I follow the Angular 2 quick start guide and I am stuck right at the beginning.

My company filters our network connections and changes the SSL response. In a middle-aged man, they assign a self-signed certificate as a CA certificate of destination.

Therefore, when I execute the second command

npm install -g tsd tsd query angular2 --action install 

I get this:

 stream.js:75 throw er; // Unhandled stream error in pipe. ^ Error: self signed certificate in certificate chain at Error (native) at TLSSocket.<anonymous> (_tls_wrap.js:908:38) at emitNone (events.js:67:13) at TLSSocket.emit (events.js:163:7) at TLSSocket._finishInit (_tls_wrap.js:496:8) 

Does anyone know a way to disable self-signed certificate authentication?

+5
source share
2 answers

One small FYI first: if you just want to learn AngularJS, this may not be the best way to start with TypeScript. If so, try the angularjs.org tutorial , which uses JavaScript and angular -seed.

In any case, if you want to use tsd, you need to edit the tsdrc file (in the user's home directory), install a proxy, and possibly include a strict line. See https://github.com/DefinitelyTyped/tsd#tsdrc

Following this documentation, you definitely need to add the tsdrc file:

 { "proxy": "http://proxy.example.com:88", "strictSSL" : false } 

Edit: I also don't think this is a problem with npm. So please update your question.

+5
source

A very similar error occurs for yarn :

 error An unexpected error occurred: "https://registry.yarnpkg.com/generator-jhipster: self signed certificate in certificate chain". 

after

 export NODE_TLS_REJECT_UNAUTHORIZED=0 

I get:

 error An unexpected error occurred: "https://registry.yarnpkg.com/generator-jhipster: SSL Error: SELF_SIGNED_CERT_IN_CHAIN". 

Finally, the decision , while the lower yarn is now happy to accept the man in the middle attack of my corporate proxy.

 export NODE_TLS_REJECT_UNAUTHORIZED=0 yarn config set strict-ssl false --global 
+1
source

All Articles