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/string_util.h" | 7 #include "base/string_util.h" |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 std::vector<std::string> server_protos_with_commas; | 70 std::vector<std::string> server_protos_with_commas; |
71 for (size_t i = 0; i < protos_len; ) { | 71 for (size_t i = 0; i < protos_len; ) { |
72 const size_t len = protos[i]; | 72 const size_t len = protos[i]; |
73 std::string proto_str(&protos[i + 1], len); | 73 std::string proto_str(&protos[i + 1], len); |
74 server_protos_with_commas.push_back(proto_str); | 74 server_protos_with_commas.push_back(proto_str); |
75 i += len + 1; | 75 i += len + 1; |
76 } | 76 } |
77 return JoinString(server_protos_with_commas, ','); | 77 return JoinString(server_protos_with_commas, ','); |
78 } | 78 } |
79 | 79 |
| 80 bool SSLClientSocket::WasNpnNegotiated() const { |
| 81 return was_npn_negotiated_; |
| 82 } |
| 83 |
80 NextProto SSLClientSocket::GetNegotiatedProtocol() const { | 84 NextProto SSLClientSocket::GetNegotiatedProtocol() const { |
81 return protocol_negotiated_; | 85 return protocol_negotiated_; |
82 } | 86 } |
83 | 87 |
84 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { | 88 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { |
85 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) | 89 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) |
86 return true; | 90 return true; |
87 | 91 |
88 if (error == ERR_CERT_COMMON_NAME_INVALID && | 92 if (error == ERR_CERT_COMMON_NAME_INVALID && |
89 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) | 93 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 126 |
123 bool SSLClientSocket::WasChannelIDSent() const { | 127 bool SSLClientSocket::WasChannelIDSent() const { |
124 return channel_id_sent_; | 128 return channel_id_sent_; |
125 } | 129 } |
126 | 130 |
127 void SSLClientSocket::set_channel_id_sent(bool channel_id_sent) { | 131 void SSLClientSocket::set_channel_id_sent(bool channel_id_sent) { |
128 channel_id_sent_ = channel_id_sent; | 132 channel_id_sent_ = channel_id_sent; |
129 } | 133 } |
130 | 134 |
131 } // namespace net | 135 } // namespace net |
OLD | NEW |