mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Add additional SSL configuration options. (#25079)
http://mongodb.github.io/node-mongodb-native/3.0/api/Server.html
This commit is contained in:
committed by
Ryan Cavanaugh
parent
a8de5cf374
commit
b244b1661a
Vendored
+20
@@ -326,6 +326,26 @@ declare module "mongoose" {
|
||||
/** How long driver keeps waiting for servers to come back up (default: Number.MAX_VALUE) */
|
||||
bufferMaxEntries?: number;
|
||||
|
||||
/** additional SSL configuration options */
|
||||
/** Array of valid certificates either as Buffers or Strings */
|
||||
sslCA?: ReadonlyArray<Buffer | string>;
|
||||
/** Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) */
|
||||
sslCRL?: ReadonlyArray<Buffer | string>;
|
||||
/** SSL certificate */
|
||||
sslCert?: Buffer | string;
|
||||
/** SSL private key */
|
||||
sslKey?: Buffer | string;
|
||||
/** SSL Certificate pass phrase */
|
||||
sslPass?: Buffer | string;
|
||||
/** Default: true; Server identity checking during SSL */
|
||||
checkServerIdentity?: boolean | Function;
|
||||
/** String containing the server name requested via TLS SNI. */
|
||||
servername?: string;
|
||||
|
||||
/** 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. */
|
||||
ciphers?: string;
|
||||
ecdhCurve?: string;
|
||||
|
||||
// TODO
|
||||
safe?: any;
|
||||
fsync?: any;
|
||||
|
||||
@@ -65,6 +65,25 @@ mongoose.Types.ObjectId;
|
||||
mongoose.Types.Decimal128;
|
||||
mongoose.version.toLowerCase();
|
||||
|
||||
const sslConnections: {[key: string]: mongoose.Connection} = {
|
||||
basic: mongoose.createConnection(connectUri, {ssl: true}),
|
||||
customCA: mongoose.createConnection(
|
||||
connectUri,
|
||||
{
|
||||
ssl: true,
|
||||
sslCA: [new Buffer('ca string')],
|
||||
sslCRL: [new Buffer('crl buffer')],
|
||||
sslCert: 'ssl cert',
|
||||
sslKey: new Buffer('ssl private key'),
|
||||
sslPass: 'ssl password',
|
||||
servername: 'localhost',
|
||||
checkServerIdentity: true,
|
||||
ciphers: 'ciphers',
|
||||
ecdhCurve: 'ecdhCurve',
|
||||
}
|
||||
),
|
||||
};
|
||||
|
||||
/*
|
||||
* section collection.js
|
||||
* http://mongoosejs.com/docs/api.html#collection-js
|
||||
|
||||
Reference in New Issue
Block a user