Skip to content

Commit b8c1203

Browse files
author
John Haley
committed
Updated clone examples to use the new cert check API
1 parent 25d7d88 commit b8c1203

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/clone.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ fse.remove(path).then(function() {
99
nodegit.Clone.clone(
1010
"https://github.com/nodegit/nodegit.git",
1111
path,
12-
{ ignoreCertErrors: 1})
12+
{
13+
remoteCallbacks: {
14+
certificateCheck: function() {
15+
// github will fail cert check on some OSX machines
16+
// this overrides that check
17+
return 1;
18+
}
19+
}
20+
})
1321
.then(function(repo) {
1422
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5");
1523
})

examples/cloneFromGithubWith2Factor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ var opts = { ignoreCertErrors: 1};
2525
var repoUrl = "https://github.com/" + repoOwner + "/" + repoName + ".git";
2626

2727
var opts = {
28-
ignoreCertErrors: 1,
2928
remoteCallbacks: {
3029
credentials: function() {
3130
return nodegit.Cred.userpassPlaintextNew (token, "x-oauth-basic");
31+
},
32+
certificateCheck: function() {
33+
return 1;
3234
}
3335
}
3436
};

0 commit comments

Comments
 (0)