ssl - TSD 错误 : self signed certificate in certificate chain

标签 ssl npm tsd

我正在关注 Angular 2 quick start guide我刚开始就卡住了。

我的公司正在过滤我们的网络连接并修改 SSL 协商。在中间样式的人中,他们将自签名证书分配为目标证书的 CA。

因此当我执行第二个命令时

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

我明白了:

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)

有人知道禁用自签名证书验证的方法吗?

最佳答案

仅供引用:如果您只想学习 AngularJS,那么从 TypeScript 入手可能不是最佳方式。如果是这种情况,请尝试 tutorial on angularjs.org ,它使用 JavaScript 和 angular-seed。

无论如何,如果你想使用 tsd,你必须编辑你的 tsdrc 文件(在你的用户的主目录中),设置代理,也许,关闭 strictSSL。参见 https://github.com/DefinitelyTyped/tsd#tsdrc

按照本文档,这是您肯定需要添加到 tsdrc 文件中的内容:

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

编辑:我也不认为这是 npm 问题。所以请更新您的问题。

关于ssl - TSD 错误 : self signed certificate in certificate chain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30984239/

相关文章:

npm - Windows 上 npm typescript@1.4.1 的编译问题

node.js - 为什么 npm 给出 500 和 503 错误 : "registry error parsing json"?

php - 在不同域上测试 PayPal 证书

ssl - 使用 SSL 和 CloudFlare 将 Phoenix 应用程序部署到 Heroku "too many redirects"

ios - Restkit 和 SSL 证书错误

node.js - 如何在 npx/npm 版本 7 中使用 --node-arg?

jquery - npm WARN EPEERINVALID react-bootstrap-daterangepicker@1.0.6 需要 jquery@^1.11.3 的对等点,但没有安装

typescript - 我应该如何在 TypeScript 2 中使用 @types

typescript - 如何删除 typescript 定义?

maven - 无法使用 gradle 命令跳过 ssl 验证,但可以在 maven 中执行此操作