generator-office icon indicating copy to clipboard operation
generator-office copied to clipboard

Error: self signed certificate in certificate chain when creating project

Open mahaoyu opened this issue 3 years ago • 1 comments

Hi All,

I run into the following error when I'm trying to scaffold any project using yo office:

? Choose a project type: Office Add-in Task Pane project ? Choose a script type: JavaScript ? What do you want to name your add-in? test88 ? Which Office client application would you like to support? Excel


  Creating test88 add-in for Excel using JavaScript and Taskpane at /Users/mhansal/test88

Unable to download project zip file for "https://github.com/OfficeDev/Office-Addin-TaskPane-JS/archive/yo-office.zip". Error: self signed certificate in certificate chain

I am on macOS Monterey 12.4; npm 8.11; node v16.15.1 and [email protected]; [email protected].

After spending hour searching and trying solutions, I understand this might be related to the corporate firewall, that I'm under, but I can't seem to work out any solution. Few things I tried include:

  • npx office-addin-dev-certs uninstall / reinstall
  • npm install npm -g --ca=null and npm blog guidance
  • checking any proxy variables
  • even the unadvised npm config set strict-ssl false --global couldn't do it.

Wondering if this is an actual issue and thus reaching out here. Could anyone help me?

Thanks in advance, Mat

mahaoyu avatar Jul 04 '22 15:07 mahaoyu

Hey Matt,

I came across this issue as I was also sitting behind a corporate firewall. The way I solved this was by setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' on powershell that's $Env:NODE_TLS_REJECT_UNAUTHORIZED = '0'

It does what it says on the tin stops checking HTTPS certificates authenticity... Obviously not recommended to leave enabled but if you visit the website manually and find the certificate being served is your corporate one you can go ahead and temporarily run this change.

Hope this helps Joss

slack2450 avatar Jul 18 '22 15:07 slack2450

Hi Joss, A big belated thank you for your response. This works like a charm from powershell. Happy new year to you and all the best into 2023. Mat

mahaoyu avatar Jan 15 '23 07:01 mahaoyu