-
Notifications
You must be signed in to change notification settings - Fork 148
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
don't set the GIT_SSL_CAINFO when an external Git is used #87
Comments
After resolving #113, I have managed to use an external Git executable for cloning public repositories on both OS X and Windows. Unfortunately, it still fails on Linux. I can see such errors on the CI: GitError: Cloning into '/tmp/d-11784-3076-1xxin47.zddvqs38fr'...
fatal: unable to access 'https://github.com/TypeFox/dugite-extra.git/': Problem with the SSL CA cert (path? access rights?) The same test happily passes when I do not use an external Git executable but the one shipped with What do you think, does my error somehow related to this ticket? Thanks in advance for your kind help! |
@kittaakos yeah, this is related to your setup. Thanks for uncovering it! The bundled certificates referred to here come from the upstream curl project. I think the changes around using an external Git now break these lines (because you're using Lines 102 to 103 in a2f6b82
What if we did something like this inside that last Linux conditional? if (process.platform === 'linux') {
// when building Git for Linux and then running it from
// an arbitrary location, you should set PREFIX for the
// process to ensure that it knows how to resolve things
env.PREFIX = gitDir
// if the user hasn't specified their own certificate bundle
if (!process.env.GIT_SSL_CAINFO) {
// resolve the path to the original Git directory
const distroPath = ...
// bypass whatever certificates might be set and use
// the bundle included in the distribution
const sslCABundle = `${distroPath}/ssl/cacert.pem`
env.GIT_SSL_CAINFO = sslCABundle
}
} |
…nal Git. Signed-off-by: Akos Kitta <kittaakos@gmail.com>
Also got rid of the semicolon. Signed-off-by: Akos Kitta <kittaakos@gmail.com>
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
…nal Git. Signed-off-by: Akos Kitta <kittaakos@gmail.com>
Also got rid of the semicolon. Signed-off-by: Akos Kitta <kittaakos@gmail.com>
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
hello sir, ++ export GIT_SSL_CAINFO=/home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/GIT_SSL_CAINFO
|
@ShubhamManuSharma I'm not sure where this value is coming from:
From the Git documentation:
This should point to a file on disk containing certificates that can be used, but it doesn't look like a valid file. |
@ShubhamManuSharma actually, I think you'll need to talk with GitLab runner support as it seems that the Git operations are successful and the job times out somewhere in the pipeline:
|
If you're using dugite on Linux but want to use an external Git, you won't have the
dugite-native
distribution and it's CA bundle available. This means this file might not exist on disk.If a
LOCAL_GIT_DIRECTORY
is defined as per #85, we should not setGIT_SSL_CAINFO
and instead assume the user has theirGIT_SSL_CAINFO
environment variable set to point to their own bundle.The text was updated successfully, but these errors were encountered: