forked from nodejscn/node-api-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtlssocket_getpeercertificate_detailed.md
42 lines (35 loc) · 1.15 KB
/
tlssocket_getpeercertificate_detailed.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!-- YAML
added: v0.11.4
-->
* `detailed` {boolean} Include the full certificate chain if `true`, otherwise
include just the peer's certificate.
Returns an object representing the peer's certificate. The returned object has
some properties corresponding to the fields of the certificate.
If the full certificate chain was requested, each certificate will include a
`issuerCertificate` property containing an object representing its issuer's
certificate.
For example:
```text
{ subject:
{ C: 'UK',
ST: 'Acknack Ltd',
L: 'Rhys Jones',
O: 'node.js',
OU: 'Test TLS Certificate',
CN: 'localhost' },
issuer:
{ C: 'UK',
ST: 'Acknack Ltd',
L: 'Rhys Jones',
O: 'node.js',
OU: 'Test TLS Certificate',
CN: 'localhost' },
issuerCertificate:
{ ... another certificate, possibly with a .issuerCertificate ... },
raw: < RAW DER buffer >,
valid_from: 'Nov 11 09:52:22 2009 GMT',
valid_to: 'Nov 6 09:52:22 2029 GMT',
fingerprint: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF',
serialNumber: 'B9B0D332A1AA5635' }
```
If the peer does not provide a certificate, an empty object will be returned.