SELF_SIGNED_CERT_IN_CHAIN error on Elastic Beanstalk for NodeJS

邮差的信 提交于 2019-12-01 10:47:39

I struggled with this as well. Fix: https://gist.github.com/anonymous/fb32a4b053fe121b0b03. When applied in container_commands npm install has already run.

Was having the same issue today. I fixed it by setting my global npmrc file, as follows:

02_no-cert:
  command: "rm -rf /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc && mkdir /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc && echo 'ca = ' > /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc/npmrc"
  ignoreErrors: true

So I figured out a way to make it work:

Put this in .ebextensions:

commands:
  01_enable_rootaccess:
    command: echo Defaults:root \!requiretty >> /etc/sudoers
  02_no-cert:
    command: sudo /opt/elasticbeanstalk/node-install/node-v0.10.10-linux-x64/bin/npm config set ca ""

Worked like a charm in my case.

Sadly, didn't work for me. Amazon gave me a different version, that has not worked either:

commands: 01-command: command: '$(find /opt/elasticbeanstalk/node-install/*/bin | grep "npm$" | head -n1) config set ca ""'

It did not work for me either.

What I did find: at the time that the "commands" block is run, the node-install folder is empty. I assume this is because the commands run before node + npm is fully deployed to the bare instance.

I will try and test this assumption later today, and provide further feedback.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!