From 045d938bc82a57ddef8f68a5e1f7c01047dd2bc1 Mon Sep 17 00:00:00 2001 From: Ian Haken Date: Thu, 19 Jul 2018 14:05:10 -0700 Subject: [PATCH] Update typescript to properly reflect the format of the certificate received by the checkServerIdentity callback. --- packages/grpc-native-core/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/grpc-native-core/index.d.ts b/packages/grpc-native-core/index.d.ts index 86b76718..247970eb 100644 --- a/packages/grpc-native-core/index.d.ts +++ b/packages/grpc-native-core/index.d.ts @@ -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