-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unknown CA Authority for Github Enterprise #852
Comments
Hi, thanks for reporting. Your GitHub Enterprise host seems to be using a self-signed certificate that you need to explicitly approve somehow. Doing the steps you tried above might solve it for If you tell us which OS you're on, which hub version do you use, and how did you obtain hub (precompiled binary or compiled yourself?), we could try help you investigate how to add custom root certificates. @jingweno Do you have an idea where Go |
Hello, Thanks a lot for the help. I am on MacOS, and I got hub from the binaries downloads section here. Also, just mention that I do not need to any of that with regular Mac git, without doing the extra config mentioned above. All I did is setup the Enterprise github account to include my certificate. Thanks again. |
Going back to git transfer protocol, this piece of git config might be dangerous: # not recommended
git config --global --add http.sslVerify false You're turning off SSL certificate verification for all git operations across all hosts. That means when you try to pull git changes from any host, including GitHub.com, the operation will be performed insecurely (that is, the identity of the host will never be verified). I would recommend removing that configuration, and first exploring how you can set |
Yes, I guessed that's what that would be doing. Regular git was working for me with custom certificate on github Enterprise. |
Almost none of the git options have any effect on hub, because they are separate programs and communicate with GitHub differently. I understand how this is confusing.
You never needed that option because you disabled cert verification with |
I never had those two options in regular git usage, and git always worked fine. |
Go uses the root cert from the host if not specified. We always verify cert in current implementation. We could make it optional though by setting InsecureSkipVerify to false based on a environment variable or the |
Ok, good to know. When your company set up the GitHub Enterprise instance on the custom domain, did you ever have to set up a custom SSL certificate to access it in the web browser? |
I have the exact same issue, on Mac OSX 10.10, using
The certificate is signed by my company's root CA, and it is stored in the OS X Keychain; i.e. if I browse the site on a web browser I see a correct, green, verified connection. But I can't tell |
It seems that Go should look up certificates in Keychain on OS X. Which Go version is the Macports hub compiled with? Unfortunately, if it doesn't work, I don't know what else you could try. Maybe we need a fix in hub's own source. |
It's |
That is a very recent version of Go. I can't tell why a root cert isn't being discovered from OS X Keychain. |
I'm having this same problem.
Go version hub version OS X 10.10.3 2 factor is on for my regular Github account and for my Github Enterprise account. I was able to use the I was able to use |
@christianmlong Do you remember where you installed the certificate for your Enterprise repo system-wide so you can access the site from your web browser and other programs? |
Same issue, same versions as @christianmlong. I've installed the certificates to my keychan and I still get issues. |
I'm having the same issue. Based on the source of golang @ https://github.com/golang/go/blob/master/src/crypto/x509/root_darwin.go It looks like the only place that Go checks for certs is in the System Root Certificates keychain. It should be checking the System and the Login keychains for certs as well, but isn't. It's not possible from the Keychain Access gui to add certificates to this keychain. I've tried playing with the command line |
@stevehedrick Awesome detective work. Do you think we could/should replicate this logic to look up the cert in Login keychains from hub ourselves? Or should we add hub configuration to specify the location of custom CA bundle on disk? |
Hi!
I have:
Regular git works fine, however i had to configure it with:
|
@mislav FYI, the git-lfs project has solved a similar issue. I imagine the solution for |
Thanks for that reference! That's really useful. This is a really interesting starting point for OS X, for example. Thanks for doing this hard work in git-lfs, @sinbad! |
No problem - you actually want to use this as a starting point: git-lfs/git-lfs@cb88941#diff-9938c5ad789d4db49e660fe24b343282, the commit above was a WIP. HTH! |
Patch that makes go look for certs in |
Hi -- running into this issue at the moment, wondering what the solution is on the user's end? I'm using Hub 2.2.3 on OSX, installed via Homebrew. I'm able to pull/push to our enterprise config over HTTPS and SSH. But if I try and open a PR with Hub, I get prompted for my login and password, then hit with an error:
I'm able to log in to our site through the web just fine, and the green SSL lock appears in the nav bar. Unsure what to do here so guidance is appreciated. :) |
@tconroy Unfortunately, there is no user workaround right now. We need to replicate the git-lfs functionality (linked above) into hub first. |
@mislav I see -- very unfortunate. :( Do you have any rough/approximate ETA for when this feature will be fixed? honestly the primary draw of hub for me is the ability to do tasks such as open PR's from the command line. |
Looks like most people have been trying this on OSX. I have also not been able to get this to work on RHEL 7. Thanks. |
I am having this same issue, and out GitHub Enterprise cert is signed by a real, trusted external root CA: Post https://github.ourcompany.com/api/v3/authorizations: x509: certificate signed by unknown authority The cert chain is: ~|⇒ hub --version |
@joedj That's strange. I would have hoped that Go discovers the certificates stored in your system or login keychains. In any case, the version that you're running is really old and I encourage you to upgrade to at least v2.2.9. It might not solve your certificate problem, but it fixes a lot of other bugs. |
Thanks @mislav Unfortunately I can confirm that v2.2.9 does not resolve this issue. For reference, it looks like the relevant golang issue is golang/go#14514 (which has been closed). There is apparently a workaround for El Capitan users, which I have not tried yet:
|
I am on Windows 10 and am running into this same issue when attempting to connect to an enterprise GitHub account. (I notice that https is NOT enabled when I navigate there in the browser.) |
I get the same error "x509: certificate signed by unknown authority". I use the I understand that there is a security vulnerability here however given that git already has this feature we are only asking hub to do exactly what git is doing (and not weaken the security model). |
Any updates on this issue? |
The most debugging I've been able to do so far is:
My corp CA is in my System Keychain and set to Always Trust. Upgrading to hub v2.3.0 appears to have fixed this issue. |
@jsok I was able to resolve this myself and am able to use hub with github enterprise. You will have to compile hub yourself with Golang with CGO disabled. You can follow the following steps:
You should be able to use hub with your github enterprise now :) UpdateAs confirmed by @jsok upgrading to 2.3.0, importing the certificate to System keychain and setting it to Always Trust resolves the issue. The above mentioned method might not be needed and as @mislav said it's a just a workaround so use it only if you know what you are doing |
@rage28 Thank you for sharing your workaround! Changing a local installation of go is indeed a nuclear option that I wouldn't suggest to everyone unless they really know what they are doing, since that will affect their other go programs as well. I would much rather see us add code to hub that allows reading an extra certificate from a file or something. |
I'm also experiencing this issue working with Github Enterprise:
|
Same issue. GitHub Enterprise, valid cert, getting the warning on |
I can confirm that running the Homebrew-installed Disclaimer: In my case, it's an enterprise CA that I'm explicitly trusting, so I consider this slightly less risky than explicitly trusting a self-signed certificate, but everyone can/should do that calculation for themselves. |
This is still failing for me on MacOS Mojave 10.14.1 and Hub 2.6.0 using a private enterprise CA. The cert is trusted in my system keychain, but Hub continues to stop me at every turn with |
@forresthopkinsa There was a bug a for a while in Go (not sure if it is fixed, golang/go#24652) where it has issues accessing the certificates from System or SystemRoot, one workaround is to toggle the trust to Open Let me know if this works for you, currently I'm on 10.13.6, but I imagine I'll find out soon enough when they push the Mojave upgrade to my machine. |
Ran into this on Mojave, brew upgrade |
Hi,
I have set the local hub.host but when I try to do a 'hub pull-request', I am getting this:
Post https:myhost/mypath: x509: certificate signed by unknown authority
I tried adding the certificate manually to global git setup, like:
git config --global --add http.sslCert path-to-pem
git config --global --add http.sslVerify false
They don't seem to work.
My regular git works fine.
What else can I try?
Thanks.
The text was updated successfully, but these errors were encountered: