"unable to get local issuer certificate" error when running Probot app with GHE 2.12


#1

I’m trying to run one of the featured Probot apps (wip-bot), managed to solve the PEM_read_bio issue, however now I get the following error:

 probot run ./index.js

11:51:49.014Z  INFO probot: Listening on http://localhost:3000
11:51:49.234Z DEBUG github: GitHub request: GET /app/installations - 500 Internal Server Error
  params: {
    "per_page": 100,
    "request": {
      "rejectUnauthorized": true,
      "timeout": 0
    },
    "baseUrl": "https://github.my.company/api/v3"
  }
11:51:49.236Z ERROR probot:
  Promise {
    <rejected> { HttpError: unable to get local issuer certificate
      at ClientRequest.request.on (/ws/probot/wip-bot-upstream/node_modules/@octokit/rest/lib/request/request.js:93:14)
      at emitOne (events.js:116:13)
      at ClientRequest.emit (events.js:211:7)
      at TLSSocket.socketErrorListener (_http_client.js:387:9)
      at emitOne (events.js:116:13)
      at TLSSocket.emit (events.js:211:7)
      at emitErrorNT (internal/streams/destroy.js:64:8)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)
    name: 'HttpError',
    code: 500,
    status: 'Internal Server Error',
    headers: undefined } }
  --
  HttpError: unable to get local issuer certificate
      at ClientRequest.request.on (/ws/probot/wip-bot-upstream/node_modules/@octokit/rest/lib/request/request.js:93:14)
      at emitOne (events.js:116:13)
      at ClientRequest.emit (events.js:211:7)
      at TLSSocket.socketErrorListener (_http_client.js:387:9)
      at emitOne (events.js:116:13)
      at TLSSocket.emit (events.js:211:7)
      at emitErrorNT (internal/streams/destroy.js:64:8)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

any idea?


#2

Hi @lidortal :wave:

Would you be willing to try the request again with something like curl? I want to make sure it’s not something with the library that you are using.

This looks more like an SSL issue with your GHE instance than a GitHub App issue but I’d like to try and help you sort it our anyway :smile:


#3

Hi @tarebyte,

Thanks for your support :grinning:
I run it with curl an it failed with the following:

curl https://github.my.company/api/v3/app/installations
{
  "message": "A JSON web token could not be decoded",
  "documentation_url": "https://developer.github.com/enterprise/2.12/v3"
} 

#4

I realized that my curl request miss the private key or any other credentials :pensive:.
How the correct request should look like?