Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure fails when running against an instance with a self-signed certificate #27

Open
jlengrand opened this issue Apr 24, 2018 · 2 comments · May be fixed by #32
Open

Configure fails when running against an instance with a self-signed certificate #27

jlengrand opened this issue Apr 24, 2018 · 2 comments · May be fixed by #32
Labels
pull request ready Someone has made a pull request for it already

Comments

@jlengrand
Copy link
Collaborator

jlengrand commented Apr 24, 2018

This is what I get when I try to configure my work gitlab. I get certificate issues

[jlengrand@rn07t1c18:~/IdeaProjects/mergify]$ node index.js -c
? What is your Gitlab User ID? 6011
? What private token shall we use? [hidden]
? On what domain is your Gitlab instance? gitlab.company.net

🙀  Oh no, could not complete verify. Please review your config
{ FetchError: request to https://gitlab.company.net/api/v4/users/6011 failed, reason: unable to verify the first certificate
    at ClientRequest.<anonymous> (/Users/jlengrand/IdeaProjects/mergify/node_modules/node-fetch/lib/index.js:1393:11)
    at ClientRequest.emit (events.js:180:13)
    at TLSSocket.socketErrorListener (_http_client.js:395:9)
    at TLSSocket.emit (events.js:180:13)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:178:19)
  message: 'request to https://gitlab.company.net/api/v4/users/6011 failed, reason: unable to verify the first certificate',
  type: 'system',
  errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' }

So it looks like at the moment I can't use mergify at work. I'll look into that too.

@jlengrand
Copy link
Collaborator Author

jlengrand commented Apr 24, 2018

As @RamonGebben mentioned, it looks like adding the following line in the index fixes the issue:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

You can read more about this here.

@jlengrand
Copy link
Collaborator Author

We should probably put this behind a flag for people to be able to use mergify for instances with self-signed certificates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull request ready Someone has made a pull request for it already
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant