mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-07 22:38:13 +08:00
node - update tls getPeerCertificate return value definition
This commit is contained in:
39
types/node/index.d.ts
vendored
39
types/node/index.d.ts
vendored
@@ -1,6 +1,9 @@
|
||||
// Type definitions for Node.js v7.x
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
|
||||
// Parambir Singh <https://github.com/parambirs>
|
||||
// Christian Vaagland Tellnes <https://github.com/tellnes>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -3004,6 +3007,25 @@ declare module "tls" {
|
||||
CN: string;
|
||||
}
|
||||
|
||||
export interface PeerCertificate {
|
||||
subject: Certificate;
|
||||
issuer: Certificate;
|
||||
subjectaltname: string;
|
||||
infoAccess: { [index: string]: string[] };
|
||||
modulus: string;
|
||||
exponent: string;
|
||||
valid_from: string;
|
||||
valid_to: string;
|
||||
fingerprint: string;
|
||||
ext_key_usage: string[];
|
||||
serialNumber: string;
|
||||
raw: Buffer;
|
||||
}
|
||||
|
||||
export interface DetailedPeerCertificate extends PeerCertificate {
|
||||
issuerCertificate: DetailedPeerCertificate;
|
||||
}
|
||||
|
||||
export interface CipherNameAndProtocol {
|
||||
/**
|
||||
* The cipher name.
|
||||
@@ -3112,18 +3134,11 @@ declare module "tls" {
|
||||
* if false only the top certificate without issuer property.
|
||||
* If the peer does not provide a certificate, it returns null or an empty object.
|
||||
* @param {boolean} detailed - If true; the full chain with issuer property will be returned.
|
||||
* @returns {any} - An object representing the peer's certificate.
|
||||
* @returns {PeerCertificate | DetailedPeerCertificate} - An object representing the peer's certificate.
|
||||
*/
|
||||
getPeerCertificate(detailed?: boolean): {
|
||||
subject: Certificate;
|
||||
issuerInfo: Certificate;
|
||||
issuer: Certificate;
|
||||
raw: any;
|
||||
valid_from: string;
|
||||
valid_to: string;
|
||||
fingerprint: string;
|
||||
serialNumber: string;
|
||||
};
|
||||
getPeerCertificate(detailed: true): DetailedPeerCertificate;
|
||||
getPeerCertificate(detailed?: false): PeerCertificate;
|
||||
getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
|
||||
/**
|
||||
* Could be used to speed up handshake establishment when reconnecting to the server.
|
||||
* @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated.
|
||||
|
||||
Reference in New Issue
Block a user