Skip to content

Commit ceba64f

Browse files
committed
Merge pull request #110 from BlackYoup/master
Use custom certificate for HTTPS
2 parents 85df744 + 71e3a5c commit ceba64f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/client.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ var Client = function Client(dsn, options) {
3131
this.loggerName = options.logger || '';
3232
this.dataCallback = options.dataCallback;
3333

34+
if(this.dsn.protocol === 'https'){
35+
// In case we want to provide our own SSL certificates / keys
36+
this.ca = options.ca || null;
37+
}
38+
3439
// enabled if a dsn is set
3540
this._enabled = !!this.dsn;
3641

lib/transports.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ HTTPTransport.prototype.send = function(client, message, headers, ident) {
1717
path: client.dsn.path + 'api/store/',
1818
headers: headers,
1919
method: 'POST',
20-
port: client.dsn.port || this.defaultPort
20+
port: client.dsn.port || this.defaultPort,
21+
ca: client.ca
2122
}, req = this.transport.request(options, function(res){
2223
res.setEncoding('utf8');
2324
if(res.statusCode >= 200 && res.statusCode < 300) {

0 commit comments

Comments
 (0)