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

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

Issue 1058003004: Forget SSL error exceptions when good certs seen for regular requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 9 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_browser_tests.cc
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index ba69fe78eb8b47aee9d8ebc1bb8ecb8fff4a3cc8..f330972736cf467df881669f298e4a5e9226348d 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/ping_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -2129,6 +2130,36 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, InterstitialNotAffectedByHideShow) {
EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
}
+// Verifies that if a bad certificate is seen for a host and the user proceeds
+// through the interstitial, the decision to proceed is initially remembered.
+// However, if this is followed by another visit, and a good certificate
+// is seen for the same host, the original exception is forgotten.
+IN_PROC_BROWSER_TEST_F(SSLUITest, BadCertFollowedByGoodCert) {
+ ASSERT_TRUE(https_server_mismatched_.Start());
+
+ ui_test_utils::NavigateToURL(
+ browser(), https_server_mismatched_.GetURL("files/ssl/google.html"));
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
+
+ ChromeSSLHostStateDelegate* state =
+ reinterpret_cast<ChromeSSLHostStateDelegate*>(
+ Profile::FromBrowserContext(tab->GetBrowserContext())
+ ->GetSSLHostStateDelegate());
+
+ ProceedThroughInterstitial(tab);
+
+ EXPECT_TRUE(state->HasAllowException(tab->GetURL().host()));
+
davidben 2015/04/07 21:08:43 You should probably flush the socket pools here fo
jww 2015/04/08 00:57:40 Done.
+ net::SpawnedTestServer::SSLOptions new_options(
+ net::SpawnedTestServer::SSLOptions::CERT_OK);
+ https_server_mismatched_.set_ssl_options(new_options);
+ ui_test_utils::NavigateToURL(
+ browser(), https_server_mismatched_.GetURL("files/ssl/google.html"));
+ tab = browser()->tab_strip_model()->GetActiveWebContents();
+
+ EXPECT_FALSE(state->HasAllowException(tab->GetURL().host()));
+}
+
class SSLBlockingPageIDNTest : public SecurityInterstitialIDNTest {
protected:
// SecurityInterstitialIDNTest implementation

Powered by Google App Engine
This is Rietveld 408576698