Merge pull request #6474 from darkdh/cert_detail

Add more detail attributes for certificate-error
This commit is contained in:
Cheng Zhao 2016-07-15 08:45:36 +09:00 committed by GitHub
commit 3ace677b41
3 changed files with 30 additions and 2 deletions

View file

@ -46,6 +46,14 @@ v8::Local<v8::Value> Converter<scoped_refptr<net::X509Certificate>>::ToV8(
encoded_data.size()).ToLocalChecked();
dict.Set("data", buffer);
dict.Set("issuerName", val->issuer().GetDisplayName());
dict.Set("subjectName", val->subject().GetDisplayName());
dict.Set("serialNumber", val->serial_number());
dict.Set("validStart", val->valid_start().ToDoubleT());
dict.Set("validExpiry", val->valid_expiry().ToDoubleT());
dict.Set("fingerprint",
net::HashValue(
val->CalculateFingerprint256(val->os_cert_handle())).ToString());
return dict.GetHandle();
}

View file

@ -179,7 +179,12 @@ Returns:
* `error` String - The error code
* `certificate` Object
* `data` Buffer - PEM encoded data
* `issuerName` String
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` Buffer - DER encoded data
* `validStart` Integer - Start date of the certificate being valid
* `validExpiry` Integer - End date of the certificate being valid
* `fingerprint` String - Fingerprint of the certificate
* `callback` Function
Emitted when failed to verify the `certificate` for `url`, to trust the
@ -208,6 +213,11 @@ Returns:
* `certificateList` [Objects]
* `data` Buffer - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` - DER encoded data
* `validStart` Integer - Start date of the certificate being valid
* `validExpiry` Integer - End date of the certificate being valid
* `fingerprint` String - Fingerprint of the certificate
* `callback` Function
Emitted when a client certificate is requested.

View file

@ -211,7 +211,12 @@ Returns:
* `error` String - The error code
* `certificate` Object
* `data` Buffer - PEM encoded data
* `issuerName` String
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` - DER encoded data
* `validStart` Integer - Start date of the certificate being valid
* `validExpiry` Integer - End date of the certificate being valid
* `fingerprint` String - Fingerprint of the certificate
* `callback` Function
Emitted when failed to verify the `certificate` for `url`.
@ -228,6 +233,11 @@ Returns:
* `certificateList` [Objects]
* `data` Buffer - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `subjectName` String - Subject's Common Name
* `serialNumber` - DER encoded data
* `validStart` Integer - Start date of the certificate being valid
* `validExpiry` Integer - End date of the certificate being valid
* `fingerprint` String - Fingerprint of the certificate
* `callback` Function
Emitted when a client certificate is requested.