Skip to content

Commit

Permalink
Closes-Bug: #1606646
Browse files Browse the repository at this point in the history
Add cert/key in SSL request options.

Change-Id: Icec3f288ac58d4c08aced6f1cda6d0d92eca81ef
  • Loading branch information
biswajit-mandal committed Aug 12, 2016
1 parent 12ad86a commit 348d55e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/serverroot/common/httpsoptions.api.js
Expand Up @@ -144,6 +144,22 @@ function updateHttpsSecureOptions (apiType, options)
logutils.logger.error('readFileSync error for ca file' + e);
}
}
var keyFile = getHttpsOptionsByAPIType(apiType, 'key');
if ((null != keyFile) && ('' != keyFile) && ("" != keyFile)) {
try {
options['key'] = fs.readFileSync(keyFile);
} catch(e) {
logutils.logger.error('readFileSync error for key file' + e);
}
}
var certFile = getHttpsOptionsByAPIType(apiType, 'cert');
if ((null != certFile) && ('' != certFile) && ("" != certFile)) {
try {
options['cert'] = fs.readFileSync(certFile);
} catch(e) {
logutils.logger.error('readFileSync error for cert file' + e);
}
}
/* https://github.com/mscdex/node-imap/issues/181 */
options['rejectUnauthorized'] = false;
var strictSSL = getHttpsOptionsByAPIType(apiType, 'strictSSL');
Expand Down

0 comments on commit 348d55e

Please sign in to comment.