Skip to content

Commit 441b7b1

Browse files
daprahamianmbroadst
authored andcommitted
feat(ssl): adds missing ssl options ssl options for ciphers and ecdhCurve
Adds missingssl options that are required for mongodb-core to establish ssl handshake with mongo server which is used certificate with ECDH curve Ports #1579 to 3.0.0
1 parent f9f2b69 commit 441b7b1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

lib/topologies/mongos.js

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ var legalOptionNames = [
4747
'sslCA',
4848
'sslCRL',
4949
'sslCert',
50+
'ciphers',
51+
'ecdhCurve',
5052
'sslKey',
5153
'sslPass',
5254
'socketOptions',
@@ -86,6 +88,8 @@ var legalOptionNames = [
8688
* @param {object} [options.sslValidate=true] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher)
8789
* @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
8890
* @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
91+
* @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
92+
* @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
8993
* @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
9094
* @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
9195
* @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)

lib/topologies/replset.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ var legalOptionNames = [
4949
'sslValidate',
5050
'sslCA',
5151
'sslCert',
52+
'ciphers',
53+
'ecdhCurve',
5254
'sslCRL',
5355
'sslKey',
5456
'sslPass',
@@ -96,7 +98,9 @@ var legalOptionNames = [
9698
* @param {object} [options.sslValidate=true] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher)
9799
* @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
98100
* @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
99-
* @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
101+
* @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher.
102+
* @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
103+
* @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
100104
* @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
101105
* @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
102106
* @param {string} [options.servername=null] String containing the server name requested via TLS SNI.

lib/topologies/server.js

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ var legalOptionNames = [
4444
'sslCA',
4545
'sslCRL',
4646
'sslCert',
47+
'ciphers',
48+
'ecdhCurve',
4749
'sslKey',
4850
'sslPass',
4951
'socketOptions',
@@ -86,6 +88,8 @@ var legalOptionNames = [
8688
* @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
8789
* @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
8890
* @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
91+
* @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
92+
* @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
8993
* @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
9094
* @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
9195
* @param {string} [options.servername=null] String containing the server name requested via TLS SNI.

0 commit comments

Comments
 (0)