Skip to content

Commit

Permalink
[fix] Add ecdhCurve option (#1228)
Browse files Browse the repository at this point in the history
Support ecdhCurve option as discussed in #1227.
  • Loading branch information
Hativ3 authored and lpinca committed Nov 1, 2017
1 parent 9303db3 commit 0f47507
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/WebSocket.js
Expand Up @@ -472,6 +472,7 @@ function initAsServerClient (socket, head, options) {
* @param {Boolean} options.rejectUnauthorized Verify or not the server certificate
* @param {String} options.passphrase The passphrase for the private key or pfx
* @param {String} options.ciphers The ciphers to use or exclude
* @param {String} options.ecdhCurve The curves for ECDH key agreement to use or exclude
* @param {(String|String[]|Buffer|Buffer[])} options.cert The certificate key
* @param {(String|String[]|Buffer|Buffer[])} options.key The private key
* @param {(String|Buffer)} options.pfx The private key, certificate, and CA certs
Expand All @@ -498,6 +499,7 @@ function initAsClient (address, protocols, options) {
rejectUnauthorized: null,
passphrase: null,
ciphers: null,
ecdhCurve: null,
cert: null,
key: null,
pfx: null,
Expand Down Expand Up @@ -598,13 +600,15 @@ function initAsClient (address, protocols, options) {
options.checkServerIdentity ||
options.passphrase ||
options.ciphers ||
options.ecdhCurve ||
options.cert ||
options.key ||
options.pfx ||
options.ca
) {
if (options.passphrase) requestOptions.passphrase = options.passphrase;
if (options.ciphers) requestOptions.ciphers = options.ciphers;
if (options.ecdhCurve) requestOptions.ecdhCurve = options.ecdhCurve;
if (options.cert) requestOptions.cert = options.cert;
if (options.key) requestOptions.key = options.key;
if (options.pfx) requestOptions.pfx = options.pfx;
Expand Down

0 comments on commit 0f47507

Please sign in to comment.