| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 5 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 ui_test_utils::NavigateToURL(browser(), http_url); | 911 ui_test_utils::NavigateToURL(browser(), http_url); |
| 912 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, | 912 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, |
| 913 observer.latest_security_style()); | 913 observer.latest_security_style()); |
| 914 EXPECT_EQ(0u, | 914 EXPECT_EQ(0u, |
| 915 observer.latest_explanations().unauthenticated_explanations.size()); | 915 observer.latest_explanations().unauthenticated_explanations.size()); |
| 916 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); | 916 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); |
| 917 EXPECT_EQ(0u, observer.latest_explanations().secure_explanations.size()); | 917 EXPECT_EQ(0u, observer.latest_explanations().secure_explanations.size()); |
| 918 EXPECT_FALSE(observer.latest_explanations().scheme_is_cryptographic); | 918 EXPECT_FALSE(observer.latest_explanations().scheme_is_cryptographic); |
| 919 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 919 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 920 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 920 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 921 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 921 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 922 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 922 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 923 | 923 |
| 924 // Visit an (otherwise valid) HTTPS page that displays mixed content. | 924 // Visit an (otherwise valid) HTTPS page that displays mixed content. |
| 925 std::string replacement_path; | 925 std::string replacement_path; |
| 926 GetFilePathWithHostAndPortReplacement( | 926 GetFilePathWithHostAndPortReplacement( |
| 927 "/ssl/page_displays_insecure_content.html", | 927 "/ssl/page_displays_insecure_content.html", |
| 928 embedded_test_server()->host_port_pair(), &replacement_path); | 928 embedded_test_server()->host_port_pair(), &replacement_path); |
| 929 | 929 |
| 930 GURL mixed_content_url(https_server_.GetURL(replacement_path)); | 930 GURL mixed_content_url(https_server_.GetURL(replacement_path)); |
| 931 ui_test_utils::NavigateToURL(browser(), mixed_content_url); | 931 ui_test_utils::NavigateToURL(browser(), mixed_content_url); |
| 932 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, | 932 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, |
| 933 observer.latest_security_style()); | 933 observer.latest_security_style()); |
| 934 | 934 |
| 935 const content::SecurityStyleExplanations& mixed_content_explanation = | 935 const content::SecurityStyleExplanations& mixed_content_explanation = |
| 936 observer.latest_explanations(); | 936 observer.latest_explanations(); |
| 937 ASSERT_EQ(0u, mixed_content_explanation.unauthenticated_explanations.size()); | 937 ASSERT_EQ(0u, mixed_content_explanation.unauthenticated_explanations.size()); |
| 938 ASSERT_EQ(0u, mixed_content_explanation.broken_explanations.size()); | 938 ASSERT_EQ(0u, mixed_content_explanation.broken_explanations.size()); |
| 939 CheckSecureExplanations(mixed_content_explanation.secure_explanations, | 939 CheckSecureExplanations(mixed_content_explanation.secure_explanations, |
| 940 VALID_CERTIFICATE, browser()); | 940 VALID_CERTIFICATE, browser()); |
| 941 EXPECT_TRUE(mixed_content_explanation.scheme_is_cryptographic); | 941 EXPECT_TRUE(mixed_content_explanation.scheme_is_cryptographic); |
| 942 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 942 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 943 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 943 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 944 EXPECT_TRUE(mixed_content_explanation.displayed_insecure_content); | 944 EXPECT_TRUE(mixed_content_explanation.displayed_mixed_content); |
| 945 EXPECT_FALSE(mixed_content_explanation.ran_insecure_content); | 945 EXPECT_FALSE(mixed_content_explanation.ran_mixed_content); |
| 946 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, | 946 EXPECT_EQ(content::SECURITY_STYLE_UNAUTHENTICATED, |
| 947 mixed_content_explanation.displayed_insecure_content_style); | 947 mixed_content_explanation.displayed_insecure_content_style); |
| 948 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, | 948 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, |
| 949 mixed_content_explanation.ran_insecure_content_style); | 949 mixed_content_explanation.ran_insecure_content_style); |
| 950 | 950 |
| 951 // Visit a broken HTTPS url. | 951 // Visit a broken HTTPS url. |
| 952 GURL expired_url(https_test_server_expired.GetURL("/title1.html")); | 952 GURL expired_url(https_test_server_expired.GetURL("/title1.html")); |
| 953 ui_test_utils::NavigateToURL(browser(), expired_url); | 953 ui_test_utils::NavigateToURL(browser(), expired_url); |
| 954 | 954 |
| 955 // An interstitial should show, and an event for the lock icon on the | 955 // An interstitial should show, and an event for the lock icon on the |
| 956 // interstitial should fire. | 956 // interstitial should fire. |
| 957 content::WaitForInterstitialAttach(web_contents); | 957 content::WaitForInterstitialAttach(web_contents); |
| 958 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); | 958 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); |
| 959 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); | 959 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); |
| 960 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 960 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 961 INVALID_CERTIFICATE, browser()); | 961 INVALID_CERTIFICATE, browser()); |
| 962 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 962 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 963 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 963 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 964 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 964 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 965 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 965 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 966 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 966 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 967 | 967 |
| 968 // Before clicking through, navigate to a different page, and then go | 968 // Before clicking through, navigate to a different page, and then go |
| 969 // back to the interstitial. | 969 // back to the interstitial. |
| 970 GURL valid_https_url(https_server_.GetURL("/title1.html")); | 970 GURL valid_https_url(https_server_.GetURL("/title1.html")); |
| 971 ui_test_utils::NavigateToURL(browser(), valid_https_url); | 971 ui_test_utils::NavigateToURL(browser(), valid_https_url); |
| 972 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, | 972 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, |
| 973 observer.latest_security_style()); | 973 observer.latest_security_style()); |
| 974 EXPECT_EQ(0u, | 974 EXPECT_EQ(0u, |
| 975 observer.latest_explanations().unauthenticated_explanations.size()); | 975 observer.latest_explanations().unauthenticated_explanations.size()); |
| 976 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); | 976 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); |
| 977 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 977 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 978 VALID_CERTIFICATE, browser()); | 978 VALID_CERTIFICATE, browser()); |
| 979 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 979 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 980 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 980 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 981 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 981 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 982 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 982 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 983 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 983 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 984 | 984 |
| 985 // After going back to the interstitial, an event for a broken lock | 985 // After going back to the interstitial, an event for a broken lock |
| 986 // icon should fire again. | 986 // icon should fire again. |
| 987 ui_test_utils::NavigateToURL(browser(), expired_url); | 987 ui_test_utils::NavigateToURL(browser(), expired_url); |
| 988 content::WaitForInterstitialAttach(web_contents); | 988 content::WaitForInterstitialAttach(web_contents); |
| 989 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); | 989 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); |
| 990 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); | 990 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); |
| 991 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 991 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 992 INVALID_CERTIFICATE, browser()); | 992 INVALID_CERTIFICATE, browser()); |
| 993 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 993 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 994 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 994 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 995 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 995 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 996 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 996 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 997 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 997 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 998 | 998 |
| 999 // Since the next expected style is the same as the previous, clear | 999 // Since the next expected style is the same as the previous, clear |
| 1000 // the observer (to make sure that the event fires twice and we don't | 1000 // the observer (to make sure that the event fires twice and we don't |
| 1001 // just see the previous event's style). | 1001 // just see the previous event's style). |
| 1002 observer.ClearLatestSecurityStyleAndExplanations(); | 1002 observer.ClearLatestSecurityStyleAndExplanations(); |
| 1003 | 1003 |
| 1004 // Other conditions cannot be tested on this host after clicking | 1004 // Other conditions cannot be tested on this host after clicking |
| 1005 // through because once the interstitial is clicked through, all URLs | 1005 // through because once the interstitial is clicked through, all URLs |
| 1006 // for this host will remain in a broken state. | 1006 // for this host will remain in a broken state. |
| 1007 ProceedThroughInterstitial(web_contents); | 1007 ProceedThroughInterstitial(web_contents); |
| 1008 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); | 1008 CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID, browser()); |
| 1009 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 1009 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 1010 INVALID_CERTIFICATE, browser()); | 1010 INVALID_CERTIFICATE, browser()); |
| 1011 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 1011 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 1012 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 1012 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 1013 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 1013 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 1014 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 1014 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 1015 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 1015 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 // Visit a valid HTTPS page, then a broken HTTPS page, and then go back, | 1018 // Visit a valid HTTPS page, then a broken HTTPS page, and then go back, |
| 1019 // and test that the observed security style matches. | 1019 // and test that the observed security style matches. |
| 1020 #if defined(OS_CHROMEOS) | 1020 #if defined(OS_CHROMEOS) |
| 1021 // Flaky on Chrome OS. See https://crbug.com/638576. | 1021 // Flaky on Chrome OS. See https://crbug.com/638576. |
| 1022 #define MAYBE_SecurityStyleChangedObserverGoBack \ | 1022 #define MAYBE_SecurityStyleChangedObserverGoBack \ |
| 1023 DISABLED_SecurityStyleChangedObserverGoBack | 1023 DISABLED_SecurityStyleChangedObserverGoBack |
| 1024 #else | 1024 #else |
| 1025 #define MAYBE_SecurityStyleChangedObserverGoBack \ | 1025 #define MAYBE_SecurityStyleChangedObserverGoBack \ |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1046 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, | 1046 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, |
| 1047 observer.latest_security_style()); | 1047 observer.latest_security_style()); |
| 1048 EXPECT_EQ(0u, | 1048 EXPECT_EQ(0u, |
| 1049 observer.latest_explanations().unauthenticated_explanations.size()); | 1049 observer.latest_explanations().unauthenticated_explanations.size()); |
| 1050 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); | 1050 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); |
| 1051 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 1051 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 1052 VALID_CERTIFICATE, browser()); | 1052 VALID_CERTIFICATE, browser()); |
| 1053 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 1053 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 1054 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 1054 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 1055 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 1055 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 1056 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 1056 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 1057 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 1057 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 1058 | 1058 |
| 1059 // Navigate to a bad HTTPS page on a different host, and then click | 1059 // Navigate to a bad HTTPS page on a different host, and then click |
| 1060 // Back to verify that the previous good security style is seen again. | 1060 // Back to verify that the previous good security style is seen again. |
| 1061 GURL expired_https_url(https_test_server_expired.GetURL("/title1.html")); | 1061 GURL expired_https_url(https_test_server_expired.GetURL("/title1.html")); |
| 1062 host_resolver()->AddRule("www.example_broken.test", "127.0.0.1"); | 1062 host_resolver()->AddRule("www.example_broken.test", "127.0.0.1"); |
| 1063 GURL::Replacements replace_host; | 1063 GURL::Replacements replace_host; |
| 1064 replace_host.SetHostStr("www.example_broken.test"); | 1064 replace_host.SetHostStr("www.example_broken.test"); |
| 1065 GURL https_url_different_host = | 1065 GURL https_url_different_host = |
| 1066 expired_https_url.ReplaceComponents(replace_host); | 1066 expired_https_url.ReplaceComponents(replace_host); |
| 1067 | 1067 |
| 1068 ui_test_utils::NavigateToURL(browser(), https_url_different_host); | 1068 ui_test_utils::NavigateToURL(browser(), https_url_different_host); |
| 1069 | 1069 |
| 1070 content::WaitForInterstitialAttach(web_contents); | 1070 content::WaitForInterstitialAttach(web_contents); |
| 1071 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); | 1071 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); |
| 1072 CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID, | 1072 CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID, |
| 1073 browser()); | 1073 browser()); |
| 1074 ProceedThroughInterstitial(web_contents); | 1074 ProceedThroughInterstitial(web_contents); |
| 1075 CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID, | 1075 CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID, |
| 1076 browser()); | 1076 browser()); |
| 1077 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 1077 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 1078 INVALID_CERTIFICATE, browser()); | 1078 INVALID_CERTIFICATE, browser()); |
| 1079 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 1079 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 1080 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 1080 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 1081 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 1081 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 1082 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 1082 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 1083 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 1083 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 1084 | 1084 |
| 1085 content::WindowedNotificationObserver back_nav_load_observer( | 1085 content::WindowedNotificationObserver back_nav_load_observer( |
| 1086 content::NOTIFICATION_LOAD_STOP, | 1086 content::NOTIFICATION_LOAD_STOP, |
| 1087 content::Source<content::NavigationController>( | 1087 content::Source<content::NavigationController>( |
| 1088 &web_contents->GetController())); | 1088 &web_contents->GetController())); |
| 1089 chrome::GoBack(browser(), CURRENT_TAB); | 1089 chrome::GoBack(browser(), CURRENT_TAB); |
| 1090 back_nav_load_observer.Wait(); | 1090 back_nav_load_observer.Wait(); |
| 1091 | 1091 |
| 1092 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, | 1092 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED, |
| 1093 observer.latest_security_style()); | 1093 observer.latest_security_style()); |
| 1094 EXPECT_EQ(0u, | 1094 EXPECT_EQ(0u, |
| 1095 observer.latest_explanations().unauthenticated_explanations.size()); | 1095 observer.latest_explanations().unauthenticated_explanations.size()); |
| 1096 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); | 1096 EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size()); |
| 1097 CheckSecureExplanations(observer.latest_explanations().secure_explanations, | 1097 CheckSecureExplanations(observer.latest_explanations().secure_explanations, |
| 1098 VALID_CERTIFICATE, browser()); | 1098 VALID_CERTIFICATE, browser()); |
| 1099 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 1099 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
| 1100 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 1100 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
| 1101 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 1101 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
| 1102 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 1102 EXPECT_FALSE(observer.latest_explanations().displayed_mixed_content); |
| 1103 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 1103 EXPECT_FALSE(observer.latest_explanations().ran_mixed_content); |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 // After AddNonsecureUrlHandler() is called, requests to this hostname | 1106 // After AddNonsecureUrlHandler() is called, requests to this hostname |
| 1107 // will use obsolete TLS settings. | 1107 // will use obsolete TLS settings. |
| 1108 const char kMockNonsecureHostname[] = "example-nonsecure.test"; | 1108 const char kMockNonsecureHostname[] = "example-nonsecure.test"; |
| 1109 const int kObsoleteTLSVersion = net::SSL_CONNECTION_VERSION_TLS1_1; | 1109 const int kObsoleteTLSVersion = net::SSL_CONNECTION_VERSION_TLS1_1; |
| 1110 // ECDHE_RSA + AES_128_CBC with HMAC-SHA1 | 1110 // ECDHE_RSA + AES_128_CBC with HMAC-SHA1 |
| 1111 const uint16_t kObsoleteCipherSuite = 0xc013; | 1111 const uint16_t kObsoleteCipherSuite = 0xc013; |
| 1112 | 1112 |
| 1113 // A URLRequestMockHTTPJob that mocks a TLS connection with the obsolete | 1113 // A URLRequestMockHTTPJob that mocks a TLS connection with the obsolete |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 ChromeSecurityStateModelClient* model_client = | 1395 ChromeSecurityStateModelClient* model_client = |
| 1396 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 1396 ChromeSecurityStateModelClient::FromWebContents(web_contents); |
| 1397 ASSERT_TRUE(model_client); | 1397 ASSERT_TRUE(model_client); |
| 1398 const SecurityStateModel::SecurityInfo& security_info = | 1398 const SecurityStateModel::SecurityInfo& security_info = |
| 1399 model_client->GetSecurityInfo(); | 1399 model_client->GetSecurityInfo(); |
| 1400 EXPECT_EQ(SecurityStateModel::SECURE, security_info.security_level); | 1400 EXPECT_EQ(SecurityStateModel::SECURE, security_info.security_level); |
| 1401 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); | 1401 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 } // namespace | 1404 } // namespace |
| OLD | NEW |