Support CA fingerprint validation (#1499)
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com> Co-authored-by: Ioannis Kakavas <ioannis@elastic.co>
This commit is contained in:
committed by
GitHub
parent
b0a7a21f72
commit
2d1505eb2b
@ -36,6 +36,7 @@ class BaseConnectionPool {
|
||||
this._ssl = opts.ssl
|
||||
this._agent = opts.agent
|
||||
this._proxy = opts.proxy || null
|
||||
this._caFingerprint = opts.caFingerprint || null
|
||||
}
|
||||
|
||||
getConnection () {
|
||||
@ -72,6 +73,8 @@ class BaseConnectionPool {
|
||||
if (opts.agent == null) opts.agent = this._agent
|
||||
/* istanbul ignore else */
|
||||
if (opts.proxy == null) opts.proxy = this._proxy
|
||||
/* istanbul ignore else */
|
||||
if (opts.caFingerprint == null) opts.caFingerprint = this._caFingerprint
|
||||
|
||||
const connection = new this.Connection(opts)
|
||||
|
||||
|
||||
1
lib/pool/index.d.ts
vendored
1
lib/pool/index.d.ts
vendored
@ -31,6 +31,7 @@ interface BaseConnectionPoolOptions {
|
||||
auth?: BasicAuth | ApiKeyAuth;
|
||||
emit: (event: string | symbol, ...args: any[]) => boolean;
|
||||
Connection: typeof Connection;
|
||||
caFingerprint?: string;
|
||||
}
|
||||
|
||||
interface ConnectionPoolOptions extends BaseConnectionPoolOptions {
|
||||
|
||||
Reference in New Issue
Block a user