6

I am following the Angular 2 quick start guide and I'm stuck right at the beginning of it.

My company is filtering our network connections and modifying SSL negociation. In a man in the middle style they assign a self signed certificate as the CA of the destination's certificate.

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 anybody know a way of disabling the self signed certificate verification?

2 Answers 2

5

One little FYI first : if you just want to learn AngularJS, maybe it's not the best way to start with TypeScript. If it's the case for you, try the tutorial on angularjs.org, which use JavaScript and angular-seed.

Anyway, if you want to use tsd, you have to edit your tsdrc file (in your user's home directory), to set the proxy, and maybe, to turn of strictSSL. See https://github.com/DefinitelyTyped/tsd#tsdrc

Following this documentation, this is what you certainly need to add to your tsdrc file :

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

Edit : I also don't think it's an npm problem. So please update your question.

Sign up to request clarification or add additional context in comments.

4 Comments

And if you have others problems, with npm this time, see stackoverflow.com/questions/7559648/…
Hi nonox, thanks for your support. With the tsdrc file config it worked like a charm.
Great :) Now, you just have to change the title of the question from "NPM Error" to "TSD error". thx
Just mentioning in case someone faces similar problem like me. I was running into this error -->>> error An unexpected error occurred: "https://registry.yarnpkg.com/@angular%2fcompiler: self signed certificate in certificate chain". So just added a .tsdrc file to my angular2-project and put in { "strictSSL" : false } and then ran "yarn" and it worked.
5

For yarn a very similar error occurs:

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 solution, with the below yarn is now happy to accept the man in the middle attack by my corporate proxy.

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

1 Comment

Thanks, this saved my day. I had the same issue to use "create-react-app", got the same error "SSL Error: SELF_SIGNED_CERT_IN_CHAIN".. Google brought me to this SO question and your "yarn config set strict-ssl false --global" saved my day.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.