Update typescript to properly reflect the format of the certificate received by the checkServerIdentity callback.

This commit is contained in:
Ian Haken 2018-07-19 14:05:10 -07:00
parent 34930310d2
commit 045d938bc8
1 changed files with 5 additions and 1 deletions

View File

@ -794,13 +794,17 @@ declare module "grpc" {
ERROR,
}
export interface Certificate {
raw: Buffer;
}
/**
* A callback that will receive the expected hostname and presented peer
* certificate as parameters. The callback should return an error to
* indicate that the presented certificate is considered invalid and
* otherwise returned undefined.
*/
export type CheckServerIdentityCallback = (hostname: string, cert: string) => Error | undefined;
export type CheckServerIdentityCallback = (hostname: string, cert: Certificate) => Error | undefined;
/**
* Additional peer verification options that can be set when creating