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/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/ec_private_key.h" | 10 #include "crypto/ec_private_key.h" |
11 #include "net/base/connection_type_histograms.h" | 11 #include "net/base/connection_type_histograms.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 #include "net/ssl/channel_id_service.h" | 13 #include "net/ssl/channel_id_service.h" |
14 #include "net/ssl/ssl_cipher_suite_names.h" | 14 #include "net/ssl/ssl_cipher_suite_names.h" |
15 #include "net/ssl/ssl_config_service.h" | 15 #include "net/ssl/ssl_config_service.h" |
16 #include "net/ssl/ssl_connection_status_flags.h" | 16 #include "net/ssl/ssl_connection_status_flags.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 SSLClientSocket::SSLClientSocket() | 20 SSLClientSocket::SSLClientSocket() |
21 : protocol_negotiated_(kProtoUnknown), | 21 : protocol_negotiated_(kProtoUnknown), |
22 channel_id_sent_(false), | |
23 signed_cert_timestamps_received_(false), | 22 signed_cert_timestamps_received_(false), |
24 stapled_ocsp_response_received_(false), | 23 stapled_ocsp_response_received_(false), |
25 negotiation_extension_(kExtensionUnknown) { | 24 negotiation_extension_(kExtensionUnknown) { |
26 } | 25 } |
27 | 26 |
28 // static | 27 // static |
29 NextProto SSLClientSocket::NextProtoFromString( | 28 NextProto SSLClientSocket::NextProtoFromString( |
30 const std::string& proto_string) { | 29 const std::string& proto_string) { |
31 if (proto_string == "http1.1" || proto_string == "http/1.1") { | 30 if (proto_string == "http1.1" || proto_string == "http/1.1") { |
32 return kProtoHTTP11; | 31 return kProtoHTTP11; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return true; | 104 return true; |
106 return (load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) && | 105 return (load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) && |
107 IsCertificateError(error); | 106 IsCertificateError(error); |
108 } | 107 } |
109 | 108 |
110 void SSLClientSocket::set_negotiation_extension( | 109 void SSLClientSocket::set_negotiation_extension( |
111 SSLNegotiationExtension negotiation_extension) { | 110 SSLNegotiationExtension negotiation_extension) { |
112 negotiation_extension_ = negotiation_extension; | 111 negotiation_extension_ = negotiation_extension; |
113 } | 112 } |
114 | 113 |
115 bool SSLClientSocket::WasChannelIDSent() const { | |
116 return channel_id_sent_; | |
117 } | |
118 | |
119 void SSLClientSocket::set_channel_id_sent(bool channel_id_sent) { | |
120 channel_id_sent_ = channel_id_sent; | |
121 } | |
122 | |
123 void SSLClientSocket::set_signed_cert_timestamps_received( | 114 void SSLClientSocket::set_signed_cert_timestamps_received( |
124 bool signed_cert_timestamps_received) { | 115 bool signed_cert_timestamps_received) { |
125 signed_cert_timestamps_received_ = signed_cert_timestamps_received; | 116 signed_cert_timestamps_received_ = signed_cert_timestamps_received; |
126 } | 117 } |
127 | 118 |
128 void SSLClientSocket::set_stapled_ocsp_response_received( | 119 void SSLClientSocket::set_stapled_ocsp_response_received( |
129 bool stapled_ocsp_response_received) { | 120 bool stapled_ocsp_response_received) { |
130 stapled_ocsp_response_received_ = stapled_ocsp_response_received; | 121 stapled_ocsp_response_received_ = stapled_ocsp_response_received; |
131 } | 122 } |
132 | 123 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 wire_protos.push_back(proto.size()); | 239 wire_protos.push_back(proto.size()); |
249 for (const char ch : proto) { | 240 for (const char ch : proto) { |
250 wire_protos.push_back(static_cast<uint8_t>(ch)); | 241 wire_protos.push_back(static_cast<uint8_t>(ch)); |
251 } | 242 } |
252 } | 243 } |
253 | 244 |
254 return wire_protos; | 245 return wire_protos; |
255 } | 246 } |
256 | 247 |
257 } // namespace net | 248 } // namespace net |
OLD | NEW |