title: Using REST API for Jira with node
body: <p>I'd like to collect information from privately installed Jira server but I've got a problem doing it.</p>
  <p>Of course, I can connect the the site using my Chrome browser and it also find calling REST API from the browser address bar - <em>https://myjiraaddr/rest/api/2/search</em></p>
  <p>Sending REST API request using curl works okay with -u option(username:password) from command line.</p>
  <p>But if I try it using nodejs and got an error says <em><strong>self signed certificate in certificate chain</strong></em>.</p>
  <p>Can anybody please explain what makes these differences and how to fix it?</p>
  <p>Thanks in advance :)</p>
  <pre><code>JiraApi = require('jira').JiraApi;
  
  var jira = new JiraApi('https', 'myjiraaddress', 443, 'username', 'password', '2.0.alpha1');
  
  jira.getCurrentUser(function(error, issue) {
      console.log(error);
  });
  </code></pre>
  <p>it prints...</p>
  <pre><code>Status: Error: self signed certificate in certificate chain
  </code></pre>
  <p>And error if I use jira-client npm package...</p>
  <pre><code>RequestError: Error: self signed certificate in certificate chain
      at new RequestError (/Users/hyoon/dev/node/work-tracker/node_modules/request-promise-core/lib/errors.js:14:15)
      at Request.plumbing.callback (/Users/hyoon/dev/node/work-tracker/node_modules/request-promise-core/lib/plumbing.js:87:29)
      at Request.RP$callback [as _callback] (/Users/hyoon/dev/node/work-tracker/node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (/Users/hyoon/dev/node/work-tracker/node_modules/request/request.js:185:22)
      at Request.emit (events.js:310:20)
      at Request.onRequestError (/Users/hyoon/dev/node/work-tracker/node_modules/request/request.js:877:8)
      at ClientRequest.emit (events.js:310:20)
      at TLSSocket.socketErrorListener (_http_client.js:426:9)
      at TLSSocket.emit (events.js:310:20)
      at emitErrorNT (internal/streams/destroy.js:92:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {
    cause: Error: self signed certificate in certificate chain
        at TLSSocket.onConnectSecure (_tls_wrap.js:1474:34)
        at TLSSocket.emit (events.js:310:20)
        at TLSSocket._finishInit (_tls_wrap.js:917:8)
        at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:687:12) {
      code: 'SELF_SIGNED_CERT_IN_CHAIN'
    },
    error: Error: self signed certificate in certificate chain
        at TLSSocket.onConnectSecure (_tls_wrap.js:1474:34)
        at TLSSocket.emit (events.js:310:20)
        at TLSSocket._finishInit (_tls_wrap.js:917:8)
        at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:687:12) {
      code: 'SELF_SIGNED_CERT_IN_CHAIN'
    },
  </code></pre>