Skip to content

Commit

Permalink
Merge pull request #14 from brendandburns/master
Browse files Browse the repository at this point in the history
Add support for client side certs and certificate authorities.
  • Loading branch information
agilebot1 authored Aug 1, 2016
2 parents 8842406 + 89c6f45 commit 3dcbea4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 0 additions & 4 deletions lib/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ var VcapClient = module.exports = function (info) {
return new TypeError('version must be provided');
}

if (info.protocol == 'https' && !info.token) {
return new TypeError('token must be provided as the protocol is https');
}

var request = require('./request')(info);

// ~~~~~ PUBLIC
Expand Down
13 changes: 12 additions & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,18 @@ module.exports = function (info) {
object.qs.page = object.page;
delete object.page;
}
object.strictSSL = false;
if (!info.ca) {
object.strictSSL = false;
}
if (info.cert) {
object.cert = info.cert;
}
if (info.key) {
object.key = info.key;
}
if (info.ca) {
object.ca = info.ca;
}

return request(object, function (err, resp, body) {
if (err) {
Expand Down

0 comments on commit 3dcbea4

Please sign in to comment.