return BSON regular expressions as BSONRegExp instances.返回BSON正则表达式作为BSONRegExp实例。
Optionally override the trusted CA certificates. 可选地覆盖受信任的CA证书。Default is to trust the well-known CAs curated by Mozilla. 默认设置是信任Mozilla管理的知名CA。Mozilla's CAs are completely replaced when CAs are explicitly specified using this option.当使用此选项显式指定CA时,Mozilla的CA将被完全替换。
Cert chains in PEM format. One cert chain should be provided per private key. PEM格式的证书链。每个私钥应提供一个证书链。Each cert chain should consist of the PEM formatted certificate for a provided private key, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see ca). 每个证书链应按顺序由所提供的私钥的PEM格式证书组成,然后是PEM格式的中间证书(如果有),不包括根CA(根CA必须事先为对等方所知,请参阅CA)。When providing multiple cert chains, they do not have to be in the same order as their private keys in key. 当提供多个证书链时,它们不必与密钥中的私钥顺序相同。If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail.如果没有提供中间证书,对等方将无法验证证书,握手将失败。
the serializer will check if keys are valid.序列化程序将检查键是否有效。
Verifies the certificate 验证证书cert
is issued to hostname
.cert
是否颁发给hostname
。
Returns Error object, populating it with 返回Error对象,在失败时用reason
, host
, and cert
on failure. reason
、host
和cert
填充它。On success, returns undefined.成功后,返回undefined
。
This function is intended to be used in combination with the此函数旨在与checkServerIdentity
option that can be passed to connect and as such operates on a certificate object
. checkServerIdentity
选项结合使用,该选项可以传递给连接,因此可以在证书对象上运行。For other purposes, consider using 出于其他目的,请考虑改用x509.checkHost()
instead.x509.checkHost()
。
This function can be overwritten by providing an alternative function as the通过提供另一个函数作为传递给options.checkServerIdentity
option that is passed to tls.connect()
. tls.connect()
的options.checkServerIdentity
选项,可以覆盖此函数。The overwriting function can call 覆盖函数当然可以调用tls.checkServerIdentity()
of course, to augment the checks done with additional verification.tls.checkServerIdentity()
,以通过附加验证来增强所做的检查。
This function is only called if the certificate passed all other checks, such as being issued by trusted CA (仅当证书通过所有其他检查(例如由可信CA(options.ca
).options.ca
)颁发)时,才调用此函数。
Earlier versions of Node.js incorrectly accepted certificates for a given如果存在匹配的hostname
if a matching uniformResourceIdentifier
subject alternative name was present (see CVE-2021-44531). uniformResourceIdentifier
主题替代名称,则Node.js的早期版本错误地接受给定hostname
的证书(请参阅CVE-2021-44531)。Applications that wish to accept希望接受uniformResourceIdentifier
subject alternative names can use a customoptions.checkServerIdentity
function that implements the desired behavior.uniformResourceIdentifier
主题替代名称的应用程序可以使用实现所需行为的自定义options.checkServerIdentity
函数。
The host name or IP address to verify the certificate against.要验证证书的主机名或IP地址。
A 表示对等方证书的证书对象。certificate object
representing the peer's certificate.
Cipher suite specification, replacing the default. 密码套件规范,替换默认值。For more information, see modifying the default cipher suite. 有关详细信息,请参阅修改默认密码套件。Permitted ciphers can be obtained via tls.getCiphers(). 允许的密码可以通过tls.getCiphers()
获得。Cipher names must be uppercased in order for OpenSSL to accept them.密码名称必须大写,OpenSSL才能接受它们。
PEM formatted CRLs (Certificate Revocation Lists).PEM格式的CRL(证书吊销列表)。
Indicates that a client should directly connect to a node without attempting to discover its topology type指示客户端应直接连接到节点而不尝试发现其拓扑类型
A string describing a named curve or a colon separated list of curve NIDs or names, for example P-521:P-384:P-256, to use for ECDH key agreement. 描述用于ECDH密钥协议的命名曲线或以冒号分隔的曲线NID或名称列表的字符串,例如P-521:P-384:P-256。Set to auto to select the curve automatically. 设置为自动以自动选择曲线。Use crypto.getCurves() to obtain a list of available curve names. 使用crypto.getCurves()
获取可用曲线名称的列表。On recent releases, openssl ecparam -list_curves will also display the name and description of each available elliptic curve. 在最近的版本中,openssl ecparam-list_curves还将显示每个可用椭圆曲线的名称和描述。Default: tls.DEFAULT_ECDH_CURVE.默认值:tls.DEFAULT_ECDH_CURVE
。
Enable utf8 validation when deserializing BSON documents. 反序列化BSON文档时启用utf8验证。Defaults to true.默认为true
。
allow to specify if there what fields we wish to return as unserialized raw buffer.允许指定是否存在我们希望作为非序列化原始缓冲区返回的字段。
serialize will not emit undefined fields (default:true)序列化不会发出未定义的字段(默认值:true
)
Private keys in PEM format. PEM allows the option of private keys being encrypted. PEM格式的私钥。PEM允许选择加密私钥。Encrypted keys will be decrypted with options.passphrase. 加密的密钥将使用options密码进行解密。Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form 使用不同算法的多个密钥可以作为未加密密钥字符串或缓冲区的数组提供,也可以作为{pem: <string|buffer>[, passphrase: <string>]}
. {pem: <string|buffer>[, passphrase: <string>]}
形式的对象数组提供。The object form can only occur in an array. object.passphrase is optional. 对象形式只能出现在数组中。objectpassphrase是可选的。Encrypted keys will be decrypted with 加密密钥将使用object.passphrase
if provided, or options.passphrase
if it is not.object.passphrase
(如果提供)或options.passphrase
(如果不提供前者)进行解密。
The maximum number of connections that may be in the process of being established concurrently by the connection pool.连接池可能同时建立的最大连接数。
The maximum amount of time a connection should remain idle in the connection pool before being marked idle.连接在被标记为空闲之前应在连接池中保持空闲的最长时间。
The maximum number of connections that may be associated with a pool at a given time. 给定时间可能与池关联的最大连接数。This includes in use and available connections.这包括正在使用和可用的连接。
The minimum number of connections that MUST exist at any moment in a single connection pool.单个连接池中任何时候必须存在的最小连接数。
Shared passphrase used for a single private key and/or a PFX.用于单个私钥和/或PFX的共享密码。
PFX or PKCS12 encoded private key and certificate chain. PFX或PKCS12编码的私钥和证书链。pfx is an alternative to providing key and cert individually. pfx是单独提供密钥和证书的替代方案。PFX is usually encrypted, if it is, passphrase will be used to decrypt it. PFX通常是加密的,如果是,将使用密码来解密。Multiple PFX can be provided either as an array of unencrypted PFX buffers, or an array of objects in the form 多个PFX可以提供为未加密的PFX缓冲区数组,也可以提供为{buf: <string|buffer>[, passphrase: <string>]}
. {buf: <string|buffer>[, passphrase: <string>]}
形式的对象数组。The object form can only occur in an array. 对象形式只能出现在数组中。object.passphrase
is optional. object.passphrase
是可选的。Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.加密的PFX将使用object.passphrase
(如果提供)或options.passphrase
(如果不提供)进行解密。
when deserializing a Binary will return it as a node.js Buffer instance.当反序列化Binary时,它将作为node.js Buffer实例返回。
when deserializing a Long will fit it into a Number if it's smaller than 53 bits当反序列化Long时,如果Long小于53位,它将适合Number
when deserializing will promote BSON values to their Node.js closest equivalent types.当反序列化将把BSON值提升到它们的Node.js最接近的等效类型时。
Return BSON filled buffers from operations从操作返回BSON填充的缓冲区
If true the server will reject any connection which is not authorized with the list of supplied CAs. 如果为true
,则服务器将拒绝未经授权的任何连接。This option only has an effect if requestCert is true.此选项仅在requestCert为true
时有效。
The name of the replica set to connect to要连接到的副本集的名称
An optional TLS context object from tls.createSecureContext()tls.createSecurityContext()
中的可选TLS上下文对象
Legacy mechanism to select the TLS protocol version to use, it does not support independent control of the minimum and maximum version, and does not support limiting the protocol to TLSv1.3. 选择要使用的TLS协议版本的传统机制,它不支持对最低和最高版本的独立控制,也不支持将协议限制为TLSv1.3。Use minVersion and maxVersion instead. 请改用minVersion和maxVersion。The possible values are listed as SSL_METHODS, use the function names as strings. 可能的值列为SSL_METHOD,使用函数名作为字符串。For example, use 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow any TLS protocol version up to TLSv1.3. 例如,使用“TLSv1_1_method”强制TLS版本1.1,或使用“TLS_method”允许TLSv1.3以下的任何TLS协议版本。It is not recommended to use TLS versions less than 1.2, but it may be required for interoperability. 不建议使用低于1.2的TLS版本,但为了实现互操作性,可能需要使用TLS版本。Default: none, see minVersion.默认值:无,请参阅minVersion。
serialize the javascript functions (default:false).序列化javascript函数(默认值:false
)。
MongoDB server API versionMongoDB服务器API版本
How long to block for server selection before throwing an error在抛出错误之前为服务器选择阻塞多长时间
The maximum amount of time operation execution should wait for a connection to become available. 操作执行等待连接可用的最长时间。The default is 0 which means there is no limit.默认值为0,表示没有限制。
Generated using TypeDoc
An array of strings or a Buffer naming possible ALPN protocols. (Protocols should be ordered by their priority.)命名可能的ALPN协议的字符串数组或缓冲区。(协议应按其优先级排序。)