| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "crypto/ec_private_key.h" | 9 #include "crypto/ec_private_key.h" |
| 10 #include "net/ssl/server_bound_cert_service.h" | 10 #include "net/ssl/server_bound_cert_service.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool SSLClientSocket::WasNpnNegotiated() const { | 98 bool SSLClientSocket::WasNpnNegotiated() const { |
| 99 return was_npn_negotiated_; | 99 return was_npn_negotiated_; |
| 100 } | 100 } |
| 101 | 101 |
| 102 NextProto SSLClientSocket::GetNegotiatedProtocol() const { | 102 NextProto SSLClientSocket::GetNegotiatedProtocol() const { |
| 103 return protocol_negotiated_; | 103 return protocol_negotiated_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 // static | |
| 107 std::string SSLClientSocket::FormatSessionCacheKey( | |
| 108 std::string host_and_port, | |
| 109 std::string ssl_session_cache_shard) { | |
| 110 std::string result = host_and_port; | |
| 111 result.append("/"); | |
| 112 result.append(ssl_session_cache_shard); | |
| 113 return result; | |
| 114 } | |
| 115 | |
| 116 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { | 106 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { |
| 117 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) | 107 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) |
| 118 return true; | 108 return true; |
| 119 | 109 |
| 120 if (error == ERR_CERT_COMMON_NAME_INVALID && | 110 if (error == ERR_CERT_COMMON_NAME_INVALID && |
| 121 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) | 111 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) |
| 122 return true; | 112 return true; |
| 123 | 113 |
| 124 if (error == ERR_CERT_DATE_INVALID && | 114 if (error == ERR_CERT_DATE_INVALID && |
| 125 (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) | 115 (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void SSLClientSocket::EnableConnectJobWaiting(bool enable) { | 217 void SSLClientSocket::EnableConnectJobWaiting(bool enable) { |
| 228 enable_connect_job_waiting_ = enable; | 218 enable_connect_job_waiting_ = enable; |
| 229 } | 219 } |
| 230 | 220 |
| 231 // static | 221 // static |
| 232 bool SSLClientSocket::GetEnableConnectJobWaiting() { | 222 bool SSLClientSocket::GetEnableConnectJobWaiting() { |
| 233 return enable_connect_job_waiting_; | 223 return enable_connect_job_waiting_; |
| 234 } | 224 } |
| 235 | 225 |
| 236 } // namespace net | 226 } // namespace net |
| OLD | NEW |