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

Unified Diff: chrome/browser/captive_portal/captive_portal_browsertest.cc

Issue 1223233002: Common Name Mismatch Handler For WWW Subdomain Mismatch case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Browsertests using MockCertVerifier Created 5 years, 4 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/captive_portal/captive_portal_browsertest.cc
diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc
index dd999a2fd787982b23df92d4ccae8953d7aecd60..01af6a453a04f357c167be390d444ccdef46ca50 100644
--- a/chrome/browser/captive_portal/captive_portal_browsertest.cc
+++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc
@@ -54,7 +54,9 @@
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test_utils.h"
#include "net/base/net_errors.h"
+#include "net/cert/x509_certificate.h"
#include "net/http/transport_security_state.h"
+#include "net/test/test_certificate_data.h"
#include "net/test/url_request/url_request_failed_job.h"
#include "net/test/url_request/url_request_mock_http_job.h"
#include "net/url_request/url_request.h"
@@ -345,8 +347,8 @@ void URLRequestTimeoutOnDemandJob::FailOrAbandonJobsOnIOThread(
DCHECK(job->request()->url().SchemeIsCryptographic());
net::SSLInfo info;
info.cert_status = net::CERT_STATUS_COMMON_NAME_INVALID;
- info.cert = new net::X509Certificate(
- "bad.host", "CA", base::Time::Max(), base::Time::Max());
+ info.cert = net::X509Certificate::CreateFromBytes(
+ reinterpret_cast<const char*>(google_der), sizeof(google_der));
Ryan Sleevi 2015/08/07 00:14:10 I would encourage you to use ImportCertFromFile us
Bhanu Dev 2015/08/07 22:28:48 Done.
job->NotifySSLCertificateError(info, true);
}
}

Powered by Google App Engine
This is Rietveld 408576698