Skip to content

Commit

Permalink
Merge pull request #29 from Intia/Akta3d-patch-rejectUnauthorized
Browse files Browse the repository at this point in the history
add rejectUnauthorized in options
  • Loading branch information
jaakkos committed Apr 28, 2015
2 parents cd06015 + 66469a1 commit 663f4c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
* Passphrase for the SSL key.
* Only needed if the certificate has a passphrase.
* No default
* `rejectUnauthorized`
* If true the server will reject any connection which is not authorized with the list of supplied CAs.
* Default true
* `strip_colors`
* Strip colors from messages and metadata
* Default: `false`
* Default: `false`
2 changes: 2 additions & 0 deletions lib/winston-logstash.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var Logstash = exports.Logstash = function (options) {
this.ssl_cert = options.ssl_cert || '';
this.ca = options.ca || '';
this.ssl_passphrase = options.ssl_passphrase || '';
this.rejectUnauthorized = options.rejectUnauthorized === true;

// Connection state
this.log_queue = [];
Expand Down Expand Up @@ -134,6 +135,7 @@ Logstash.prototype.connect = function () {
key: this.ssl_key ? fs.readFileSync(this.ssl_key) : null,
cert: this.ssl_cert ? fs.readFileSync(this.ssl_cert) : null,
passphrase: this.ssl_passphrase ? this.ssl_passphrase : null,
rejectUnauthorized: this.rejectUnauthorized === true,
ca: this.ca ? (function (caList) {
var caFilesList = [];

Expand Down

0 comments on commit 663f4c4

Please sign in to comment.