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

Fix #2360 by reverting "set GIT_SSL_NO_VERIFY for opposite value than #2361

Merged
merged 3 commits into from Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/core/resolvers/GitResolver.js
Expand Up @@ -26,7 +26,9 @@ function GitResolver(decEndpoint, config, logger) {
// anyway
mkdirp.sync(config.storage.empty);
process.env.GIT_TEMPLATE_DIR = config.storage.empty;
process.env.GIT_SSL_NO_VERIFY = (!config.strictSsl).toString();
if (!config.strictSsl) {
process.env.GIT_SSL_NO_VERIFY = 'true';
}
process.env.GIT_TERMINAL_PROMPT = config.interactive ? '1' : '0';

Resolver.call(this, decEndpoint, config, logger);
Expand Down
9 changes: 5 additions & 4 deletions test/core/resolvers/gitResolver.js
Expand Up @@ -50,16 +50,17 @@ describe('GitResolver', function () {
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');

resolver = new GitResolver(decEndpoint, defaultConfig(), logger);
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'false');
delete process.env.GIT_SSL_NO_VERIFY;
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');

resolver = new GitResolver(decEndpoint, defaultConfig({strictSsl: false}), logger);
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'true');
delete process.env.GIT_SSL_NO_VERIFY;

// git only checks the existence of GIT_SSL_NO_VERIFY.
// git does NOT check whether is true of false.
// Hence not exporting GIT_SSL_NO_VERIFY is effectively equivalent to 'false'
resolver = new GitResolver(decEndpoint, defaultConfig({strictSsl: true}), logger);
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'false');
delete process.env.GIT_SSL_NO_VERIFY;
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');
});
});

Expand Down