Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add two tls options #207

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ passed through from [this](https://nodejs.org/api/tls.html#new-tlstlssocketsocke
passed through from [this](https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options) constructor.
* __ecdhCurve:__ See <https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions> for more information on this option,
passed through from [this](https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options) constructor.
* __rejectUnauthorized:__ See <https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options> for more information on this option,
passed through from [this](https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options) constructor.
* __requestCert:__ See <https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options> for more information on this option,
passed through from [this](https://nodejs.org/api/tls.html#new-tlstlssocketsocket-options) constructor.

*Metadata:* Logged as string compiled by [glossy][3].

Expand Down
6 changes: 5 additions & 1 deletion lib/winston-syslog.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class Syslog extends Transport {
this.secureProtocol = options.secureProtocol;
this.ciphers = options.ciphers;
this.ecdhCurve = options.ecdhCurve;
this.rejectUnauthorized = options.rejectUnauthorized;
this.requestCert = options.requestCert;
// end options for secure socket
//
// Merge the default message options.
Expand Down Expand Up @@ -353,7 +355,9 @@ class Syslog extends Transport {
const options = {
secureProtocol: this.secureProtocol,
ciphers: this.ciphers,
ecdhCurve: this.ecdhCurve
ecdhCurve: this.ecdhCurve,
rejectUnauthorized: this.rejectUnauthorized,
requestCert: this.requestCert
};

this.socket = /^tls[4|6]?$/.test(this.protocol)
Expand Down