OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/ssl/ssl_policy.h" | 5 #include "content/browser/ssl/ssl_policy.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // The judgment is either DENIED or UNKNOWN. | 52 // The judgment is either DENIED or UNKNOWN. |
53 // For now we handle the DENIED as the UNKNOWN, which means a blocking | 53 // For now we handle the DENIED as the UNKNOWN, which means a blocking |
54 // page is shown to the user every time he comes back to the page. | 54 // page is shown to the user every time he comes back to the page. |
55 | 55 |
56 switch (handler->cert_error()) { | 56 switch (handler->cert_error()) { |
57 case net::ERR_CERT_COMMON_NAME_INVALID: | 57 case net::ERR_CERT_COMMON_NAME_INVALID: |
58 case net::ERR_CERT_DATE_INVALID: | 58 case net::ERR_CERT_DATE_INVALID: |
59 case net::ERR_CERT_AUTHORITY_INVALID: | 59 case net::ERR_CERT_AUTHORITY_INVALID: |
60 case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM: | 60 case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM: |
61 OnCertErrorInternal(handler, true); | 61 OnCertErrorInternal(handler, !handler->is_hsts_host()); |
62 break; | 62 break; |
63 case net::ERR_CERT_NO_REVOCATION_MECHANISM: | 63 case net::ERR_CERT_NO_REVOCATION_MECHANISM: |
64 // Ignore this error. | 64 // Ignore this error. |
65 handler->ContinueRequest(); | 65 handler->ContinueRequest(); |
66 break; | 66 break; |
67 case net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION: | 67 case net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION: |
68 // We ignore this error but will show a warning status in the location | 68 // We ignore this error but will show a warning status in the location |
69 // bar. | 69 // bar. |
70 handler->ContinueRequest(); | 70 handler->ContinueRequest(); |
71 break; | 71 break; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? | 209 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? |
210 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); | 210 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); |
211 } | 211 } |
212 | 212 |
213 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 213 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
214 GURL parsed_origin(origin); | 214 GURL parsed_origin(origin); |
215 if (parsed_origin.SchemeIsSecure()) | 215 if (parsed_origin.SchemeIsSecure()) |
216 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 216 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
217 } | 217 } |
OLD | NEW |