Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #2 from PrimeAdvertising/master
Browse files Browse the repository at this point in the history
Allow requests to be made against servers using invalid or self signed certificates
  • Loading branch information
vially committed Mar 12, 2014
2 parents 178bfb6 + c0f9c0c commit 2fd0182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -14,7 +14,8 @@ var options = {
port: 2087,
secure: true,
username: 'WHM_USERNAME',
accessKey: 'YOUR_ACCESS_KEY'
accessKey: 'YOUR_ACCESS_KEY',
ignoreCertError: true
};

var cpanelClient = cpanel.createClient(options);
Expand Down
6 changes: 4 additions & 2 deletions lib/cpanel.js
Expand Up @@ -10,7 +10,8 @@ exports.createClient = function (options) {
username: options.username,
password: options.password,
accessKey: options.accessKey,
path: options.path || '/json-api/'
path: options.path || '/json-api/',
ignoreCertError: options.ignoreCertError
});

return client;
Expand Down Expand Up @@ -40,7 +41,8 @@ var cpanelJsonClient = function (obj) {
host: obj.host,
port: obj.port,
path: obj.path + action + '?' + params,
headers: headers
headers: headers,
rejectUnauthorized: !obj.ignoreCertError
};
var req = obj.connection.get(options, function (res) {
var data = '';
Expand Down

0 comments on commit 2fd0182

Please sign in to comment.