From 437a6d51ef1a1522c1dc83ad9deaa662b9952522 Mon Sep 17 00:00:00 2001 From: captainmuppet <49562279+captainmuppet@users.noreply.github.com> Date: Fri, 12 Apr 2019 16:10:31 +0200 Subject: [PATCH] Fix node-socket not using the passed ca property --- src/node-socket.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node-socket.js b/src/node-socket.js index 6da5948..7b56bb6 100644 --- a/src/node-socket.js +++ b/src/node-socket.js @@ -10,6 +10,7 @@ export default class TCPSocket { constructor ({ host, port, options }) { this.host = host this.port = port + this.ca = propOr(undefined, 'ca')(options) this.ssl = propOr(false, 'useSecureTransport')(options) this.bufferedAmount = 0 this.readyState = 'connecting' @@ -20,7 +21,7 @@ export default class TCPSocket { } this._socket = this.ssl - ? tls.connect(this.port, this.host, { }, () => this._emit('open')) + ? tls.connect(this.port, this.host, { ca: this.ca }, () => this._emit('open')) : net.connect(this.port, this.host, () => this._emit('open')) // add all event listeners to the new socket @@ -87,7 +88,7 @@ export default class TCPSocket { if (this.ssl) return this._removeListeners() - this._socket = tls.connect({ socket: this._socket }, () => { this.ssl = true }) + this._socket = tls.connect({ socket: this._socket, ca: this.ca }, () => { this.ssl = true }) this._attachListeners() } }