-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
GitLab auth: Support custom root CA for https certificates signed in house #346
Comments
Hi @esbite |
Huh, if you're using self-hosted gitlab. |
Hmm. Yes we're using self hosted Gitlab. But Gitlab doesn't give me an error, I get returned correctly to the callback on HackMD with the following URL: And then I see the 500 error from HackMD. That code parameter should be the access token, right? |
Yes I read your other issue about not supporting only the Any other ideas how I can debug this? |
Well, I just tested on my local server to auth via gitlab.com and it worked. Could you check the connection logs before the OAuth error? I guess it might be some problem when the hackmd request with to code. |
Ah. Finally figured out what the underlying error was. Of course this is also a certificate problem (Error: unable to verify the first certificate). Because our internal Gitlab is also using a certificate signed by our custom root cert. And when the browser is accessing it to grant the first authorization it works. But when nodejs itself makes the request to get the access token it fails because of certificate error. How can I supply our custom root cert here, like I did for LDAP? :) |
I think that means you need to use SSL connection.
|
Are you saying that I need to put HackMD behind SSL? That seems unnecessary to me. All I need is for the outgoing OAuth request for I'm new to Node so I'm not sure how to supply a custom root CA for a request, but seems like you would need to use a library like this. Because this is a problem in node core, see issue here: This issue actually seems to be just about fixed in the absolute latest nodejs release: |
So maybe you could try on node v7.5.0? |
Haha, yeah, I guess I could. But do you yet officially support node 7? I mean the Dockerfile you have is based on 6.9 :) |
Yes we do support node 7, actually our service is running it now. |
Hey @esbite how's going? |
Sorry no time to test, we decided we are happy with LDAP auth for now. |
I think the issue caused by node.js not trust self-signed CA.
|
Closed for now. The problem was related to NodeJS and a newer version of NodeJS resolves it. The solution means installing HackMD with a newer node version. If the problem persists with a newer NodeJS version feel free to reopen |
Hi,
I'm trying to use the GitLab authentication to authenticate with our own internal gitlab. It requests the auth correctly, I authorize it on GitLab but when it returns to the callback on HackMD gives me a 500 and logs this error:
I am sending the following environment variables to HackMD:
We are running the latest master of HackMD (d6822dd) and latest Gitlab version 8.16.4.
Any ideas on what could be wrong?
The text was updated successfully, but these errors were encountered: