Skip to content

Commit

Permalink
feat(ssl): allow user to pass ssl options directly to transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Cauchois authored and mbroadst committed Jun 16, 2016
1 parent ccce732 commit 68c4a91
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/connection.js
Expand Up @@ -160,17 +160,20 @@ function Connection(connectPolicy) {
};
this._sslOptions = null;
if (options.sslOptions) {
this._sslOptions = {};
this._sslOptions = options.sslOptions;

if (options.sslOptions.keyFile) {
this._sslOptions.key = fs.readFileSync(options.sslOptions.keyFile);
delete this._sslOptions.keyFile;
}
if (options.sslOptions.certFile) {
this._sslOptions.cert = fs.readFileSync(options.sslOptions.certFile);
delete this._sslOptions.certFile;
}
if (options.sslOptions.caFile) {
this._sslOptions.ca = fs.readFileSync(options.sslOptions.caFile);
delete this._sslOptions.caFile;
}
this._sslOptions.rejectUnauthorized = options.sslOptions.rejectUnauthorized;
}

this._lastOutgoing = null; // To track whether heartbeat frame required.
Expand Down

0 comments on commit 68c4a91

Please sign in to comment.