Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detail attributes for certificate-error #6474

Merged
merged 2 commits into from Jul 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions atom/common/native_mate_converters/net_converter.cc
Expand Up @@ -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();
}

Expand Down
12 changes: 11 additions & 1 deletion docs/api/app.md
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
12 changes: 11 additions & 1 deletion docs/api/web-contents.md
Expand Up @@ -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`.
Expand All @@ -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.
Expand Down