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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual void GetSSLCertRequestInfo( | 114 virtual void GetSSLCertRequestInfo( |
115 SSLCertRequestInfo* cert_request_info) = 0; | 115 SSLCertRequestInfo* cert_request_info) = 0; |
116 | 116 |
117 // Get the application level protocol that we negotiated with the server. | 117 // Get the application level protocol that we negotiated with the server. |
118 // *proto is set to the resulting protocol (n.b. that the string may have | 118 // *proto is set to the resulting protocol (n.b. that the string may have |
119 // embedded NULs). | 119 // embedded NULs). |
120 // kNextProtoUnsupported: *proto is cleared. | 120 // kNextProtoUnsupported: *proto is cleared. |
121 // kNextProtoNegotiated: *proto is set to the negotiated protocol. | 121 // kNextProtoNegotiated: *proto is set to the negotiated protocol. |
122 // kNextProtoNoOverlap: *proto is set to the first protocol in the | 122 // kNextProtoNoOverlap: *proto is set to the first protocol in the |
123 // supported list. | 123 // supported list. |
124 virtual NextProtoStatus GetNextProto(std::string* proto) = 0; | 124 // *server_protos is set to the server advertised protocols. |
| 125 virtual NextProtoStatus GetNextProto(std::string* proto, |
| 126 std::string* server_protos) = 0; |
125 | 127 |
126 static NextProto NextProtoFromString(const std::string& proto_string); | 128 static NextProto NextProtoFromString(const std::string& proto_string); |
127 | 129 |
| 130 static const char* NextProtoStatusToString( |
| 131 const SSLClientSocket::NextProtoStatus status); |
| 132 |
| 133 // Can be used with the second argument(|server_protos|) of |GetNextProto| to |
| 134 // construct a comma separated string of server advertised protocols. |
| 135 static std::string ServerProtosToString(const std::string& server_protos); |
| 136 |
128 static bool IgnoreCertError(int error, int load_flags); | 137 static bool IgnoreCertError(int error, int load_flags); |
129 | 138 |
130 virtual bool was_npn_negotiated() const; | 139 virtual bool was_npn_negotiated() const; |
131 | 140 |
132 virtual bool set_was_npn_negotiated(bool negotiated); | 141 virtual bool set_was_npn_negotiated(bool negotiated); |
133 | 142 |
134 virtual void UseDNSSEC(DNSSECProvider*) { } | 143 virtual void UseDNSSEC(DNSSECProvider*) { } |
135 | 144 |
136 virtual bool was_spdy_negotiated() const; | 145 virtual bool was_spdy_negotiated() const; |
137 | 146 |
138 virtual bool set_was_spdy_negotiated(bool negotiated); | 147 virtual bool set_was_spdy_negotiated(bool negotiated); |
139 | 148 |
140 private: | 149 private: |
141 // True if NPN was responded to, independent of selecting SPDY or HTTP. | 150 // True if NPN was responded to, independent of selecting SPDY or HTTP. |
142 bool was_npn_negotiated_; | 151 bool was_npn_negotiated_; |
143 // True if NPN successfully negotiated SPDY. | 152 // True if NPN successfully negotiated SPDY. |
144 bool was_spdy_negotiated_; | 153 bool was_spdy_negotiated_; |
145 }; | 154 }; |
146 | 155 |
147 } // namespace net | 156 } // namespace net |
148 | 157 |
149 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 158 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
OLD | NEW |