Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: chrome/browser/ssl/ssl_interstitial_certificate_reporter.cc

Issue 979893003: Refactor ChromeFraudulentCertReporter for code reuse by SSL reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ssl/ssl_interstitial_certificate_reporter.cc
diff --git a/chrome/browser/ssl/ssl_interstitial_certificate_reporter.cc b/chrome/browser/ssl/ssl_interstitial_certificate_reporter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b3bfe76ccb4f13d48fcd9ae335e470afd6be613a
--- /dev/null
+++ b/chrome/browser/ssl/ssl_interstitial_certificate_reporter.cc
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ssl/ssl_interstitial_certificate_reporter.h"
+
+#include "chrome/browser/net/cert_logger.pb.h"
+#include "chrome/browser/net/chrome_certificate_reporter.h"
+
+using chrome_browser_net::CertLoggerRequest;
+
+// TODO(estark): Fill in a real URL when there is a live server
+// endpoint.
+const char kCertificateUploadEndpoint[] = "";
+
+SSLInterstitialCertificateReporter::SSLInterstitialCertificateReporter(
+ net::URLRequestContext* request_context)
+ : ChromeCertificateReporter(request_context, kCertificateUploadEndpoint) {
+}
+
+void SSLInterstitialCertificateReporter::SendReport(
+ const std::string& hostname,
+ const net::SSLInfo& ssl_info) {
+ // TODO(estark): Double-check that the user is opted in.
+ // TODO(estark): Temporarily, since this is no upload endpoint, just
+ // log the information.
+ CertLoggerRequest request;
+ SSLInterstitialCertificateReporter::BuildReport(hostname, ssl_info, request);
+ std::string out;
+ request.SerializeToString(&out);
+ DVLOG(20) << "SSL report for " << hostname << ":\n" << out << "\n\n";
+ return;
+}

Powered by Google App Engine
This is Rietveld 408576698