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
(cherry picked from commit 348d55e)
  • Loading branch information
biswajit-mandal committed Aug 17, 2016
1 parent 2465d3e commit 8ac20e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/serverroot/common/httpsoptions.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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 8ac20e8

Please sign in to comment.