gavinr / github-csv-tools

Import and export GitHub issues via CSV
https://npmjs.com/github-csv-tools
MIT License
661 stars 118 forks source link

Set ENV OCTOKIT_SSL_VERIFY_MODE=0 but still getting self-signed certificate error when exporting from Github Enterprise #56

Closed javierjeronimo closed 2 years ago

javierjeronimo commented 3 years ago

I'm running using npx in Windows:

npm --version
6.14.9

npm install -g github-csv-tools
C:\Users\*****\AppData\Roaming\npm\githubCsvTools -> C:\Users\*****\AppData\Roaming\npm\node_modules\github-csv-tools\index.js
+ github-csv-tools@3.1.2
updated 1 package in 0.649s

$env:OCTOKIT_SSL_VERIFY_MODE=0

npx github-csv-tools --exportAll --github_enterprise https://*****/api/v3 --token ***** --organization ***** --repository ***** --verbose

npx: installed 35 in 2.765s
error RequestError [HttpError]: request to https://*****/api/v3/repos/*****/*****/issues?state=all failed, reason: self signed certificate in certificate chain
    at C:\Users\*****\AppData\Roaming\npm-cache\_npx\9540\node_modules\github-csv-tools\node_modules\@octokit\request\dist-node\index.js:108:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Job.doExecute (C:\Users\*****\AppData\Roaming\npm-cache\_npx\9540\node_modules\github-csv-tools\node_modules\bottleneck\light.js:405:18) {
  status: 500,
  request: {
    method: 'GET',
    url: 'https://*****/api/v3/repos/*****/*****/issues?state=all',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'github-csv-tools octokit-rest.js/18.6.7 octokit-core.js/3.5.1 Node.js/14.15.2 (win32; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { hook: [Function: bound bound register] }
  }
}
Douglas-Farley commented 3 years ago

@javierjeronimo - Did you try with NODE_TLS_REJECT_UNAUTHORIZED=0 ?

I routinely use it like:

NODE_TLS_REJECT_UNAUTHORIZED=0 npx github-csv-tools -g https://****/api/v3 -o *\<org>* -r *\<repo>* -t *\<token>*