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 #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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
12 #include "net/base/host_port_pair.h" | |
wtc
2014/07/18 01:17:14
A forward declaration of class HostPortPair should
mshelley
2014/07/18 21:08:31
Done.
| |
12 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
14 #include "net/socket/ssl_socket.h" | 15 #include "net/socket/ssl_socket.h" |
15 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 | 19 |
19 class CertVerifier; | 20 class CertVerifier; |
20 class CTVerifier; | 21 class CTVerifier; |
21 class ServerBoundCertService; | 22 class ServerBoundCertService; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 kNextProtoUnsupported = 0, // The server doesn't support NPN. | 75 kNextProtoUnsupported = 0, // The server doesn't support NPN. |
75 kNextProtoNegotiated = 1, // We agreed on a protocol. | 76 kNextProtoNegotiated = 1, // We agreed on a protocol. |
76 kNextProtoNoOverlap = 2, // No protocols in common. We requested | 77 kNextProtoNoOverlap = 2, // No protocols in common. We requested |
77 // the first protocol in our list. | 78 // the first protocol in our list. |
78 }; | 79 }; |
79 | 80 |
80 // StreamSocket: | 81 // StreamSocket: |
81 virtual bool WasNpnNegotiated() const OVERRIDE; | 82 virtual bool WasNpnNegotiated() const OVERRIDE; |
82 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 83 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
83 | 84 |
85 // Formats a unique key for the SSL session cache. This method | |
86 // is necessary so that all classes create cache keys in a consistent | |
87 // manner. | |
88 // TODO(mshelley) This method will be deleted soon. | |
89 static std::string GetSessionCacheKey( | |
90 const HostPortPair& host_and_port, | |
91 const std::string& ssl_session_cache_shard); | |
92 | |
93 // Returns true if there is a cache entry in the SSL session cache | |
94 // for the cache key of the SSL socket. | |
95 // | |
96 // The cache key consists of a host and port concatenated with a session | |
97 // cache shard. These two strings are passed to the constructor of most | |
98 // subclasses of SSLClientSocket. | |
99 virtual bool InSessionCache() const = 0; | |
100 | |
101 // Tells the session cache to monitor this socket's session and inform | |
102 // its SSLConnectJobMessenger upon the sessions being made available for | |
wtc
2014/07/18 01:17:14
inform its SSLConnectJobMessenger => runs the call
mshelley
2014/07/18 21:08:31
Done.
| |
103 // resumption. | |
104 virtual void SetHandshakeSuccessCallback(const base::Closure& callback) = 0; | |
105 | |
106 // Sets the callback to be used if the socket's SSL handshake should fail. | |
107 virtual void SetHandshakeFailureCallback(const base::Closure& callback) = 0; | |
108 | |
84 // Gets the SSL CertificateRequest info of the socket after Connect failed | 109 // Gets the SSL CertificateRequest info of the socket after Connect failed |
85 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. | 110 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. |
86 virtual void GetSSLCertRequestInfo( | 111 virtual void GetSSLCertRequestInfo( |
87 SSLCertRequestInfo* cert_request_info) = 0; | 112 SSLCertRequestInfo* cert_request_info) = 0; |
88 | 113 |
89 // Get the application level protocol that we negotiated with the server. | 114 // Get the application level protocol that we negotiated with the server. |
90 // *proto is set to the resulting protocol (n.b. that the string may have | 115 // *proto is set to the resulting protocol (n.b. that the string may have |
91 // embedded NULs). | 116 // embedded NULs). |
92 // kNextProtoUnsupported: *proto is cleared. | 117 // kNextProtoUnsupported: *proto is cleared. |
93 // kNextProtoNegotiated: *proto is set to the negotiated protocol. | 118 // kNextProtoNegotiated: *proto is set to the negotiated protocol. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 bool channel_id_sent_; | 208 bool channel_id_sent_; |
184 // True if SCTs were received via a TLS extension. | 209 // True if SCTs were received via a TLS extension. |
185 bool signed_cert_timestamps_received_; | 210 bool signed_cert_timestamps_received_; |
186 // True if a stapled OCSP response was received. | 211 // True if a stapled OCSP response was received. |
187 bool stapled_ocsp_response_received_; | 212 bool stapled_ocsp_response_received_; |
188 }; | 213 }; |
189 | 214 |
190 } // namespace net | 215 } // namespace net |
191 | 216 |
192 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 217 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
OLD | NEW |