Index: extensions/browser/api/web_request/web_request_event_details.cc |
diff --git a/extensions/browser/api/web_request/web_request_event_details.cc b/extensions/browser/api/web_request/web_request_event_details.cc |
index 3099ca1f8d09d8feaba1a96e837058acb80bd95b..21ffc97caf754b77e7047c1f7e5a5d2178f6ef0b 100644 |
--- a/extensions/browser/api/web_request/web_request_event_details.cc |
+++ b/extensions/browser/api/web_request/web_request_event_details.cc |
@@ -199,4 +199,44 @@ void WebRequestEventDetails::OnDeterminedFrameData( |
callback.Run(std::move(self)); |
} |
+void WebRequestEventDetails::SetSSLInfo(const net::URLRequest* request) { |
+ const net::SSLInfo ssl_info = request->ssl_info(); |
+ base::DictionaryValue* info_dict = new base::DictionaryValue(); |
+ |
+ info_dict->Set(keys::kConnectionInfoKey, |
+ helpers::ExtractConnectionInfo(ssl_info)); |
+ |
+ base::DictionaryValue* built_dict = new base::DictionaryValue(); |
+ built_dict->SetBoolean(keys::kCertificateIssuedByKnownRootKey, |
+ ssl_info.is_issued_by_known_root); |
+ built_dict->Set(keys::kChainKey, |
+ helpers::ExtractCertificateChain(ssl_info.cert)); |
+ |
+ base::ListValue* errors = |
+ helpers::ParseCertificateStatusErrors(ssl_info.cert_status); |
+ built_dict->SetBoolean(keys::kCertificateValidKey, |
+ ssl_info.is_valid() && errors->GetSize() == 0); |
+ if (errors->GetSize() != 0) |
+ built_dict->Set(keys::kErrorsKey, errors); |
+ |
+ if (ssl_info.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) |
+ built_dict->SetBoolean(keys::kNonUniqueNameKey, true); |
+ if (ssl_info.cert_status & net::CERT_STATUS_SHA1_SIGNATURE_PRESENT) |
+ built_dict->SetBoolean(keys::kSHA1SignaturePresentKey, true); |
+ if (ssl_info.cert_status & net::CERT_STATUS_CT_COMPLIANCE_FAILED) |
+ built_dict->SetBoolean(keys::kCTComplianceFailedKey, true); |
+ |
+ built_dict->SetBoolean(keys::kEVCertificateKey, |
+ (ssl_info.cert_status & net::CERT_STATUS_IS_EV)); |
+ built_dict->SetBoolean( |
+ keys::kRevocationCheckingEnabledKey, |
+ (ssl_info.cert_status & net::CERT_STATUS_REV_CHECKING_ENABLED)); |
+ |
+ info_dict->Set(keys::kBuiltChainKey, built_dict); |
+ info_dict->Set(keys::kSentChainKey, |
+ helpers::ExtractCertificateChain(ssl_info.unverified_cert)); |
+ |
+ dict_.Set(keys::kSSLInfoKey, info_dict); |
+} |
+ |
} // namespace extensions |