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/load_flags.h" | 12 #include "net/base/load_flags.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "net/socket/ssl_socket.h" | 14 #include "net/socket/ssl_socket.h" |
15 #include "net/socket/stream_socket.h" | 15 #include "net/socket/stream_socket.h" |
16 | 16 |
17 namespace crypto { | |
18 class RSAPrivateKey; | |
Ryan Sleevi
2015/03/19 04:38:24
I really don't want to force a dependency on //cry
davidben
2015/03/25 00:05:33
Eventually SSLConfig will take both a net::X509Cer
| |
19 } | |
20 | |
17 namespace net { | 21 namespace net { |
18 | 22 |
19 class CertPolicyEnforcer; | 23 class CertPolicyEnforcer; |
20 class CertVerifier; | 24 class CertVerifier; |
21 class ChannelIDService; | 25 class ChannelIDService; |
22 class CTVerifier; | 26 class CTVerifier; |
23 class HostPortPair; | 27 class HostPortPair; |
24 class ServerBoundCertService; | 28 class ServerBoundCertService; |
25 class SSLCertRequestInfo; | 29 class SSLCertRequestInfo; |
26 struct SSLConfig; | 30 struct SSLConfig; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 const NextProtoVector& next_protos, | 230 const NextProtoVector& next_protos, |
227 bool can_advertise_http2); | 231 bool can_advertise_http2); |
228 | 232 |
229 // For unit testing only. | 233 // For unit testing only. |
230 // Returns the unverified certificate chain as presented by server. | 234 // Returns the unverified certificate chain as presented by server. |
231 // Note that chain may be different than the verified chain returned by | 235 // Note that chain may be different than the verified chain returned by |
232 // StreamSocket::GetSSLInfo(). | 236 // StreamSocket::GetSSLInfo(). |
233 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | 237 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() |
234 const = 0; | 238 const = 0; |
235 | 239 |
240 // For unit testing only. | |
241 // Specify a client certificate and the RSA private key to be used with it. | |
242 virtual void ForceClientCertificateAndKeyForTest( | |
Ryan Sleevi
2015/03/19 04:38:24
ForTesting, to get the presubmit
| |
243 scoped_refptr<X509Certificate> client_cert, | |
Ryan Sleevi
2015/03/19 04:38:24
STYLE: const scoped_refptr<X509Certificate>&
| |
244 scoped_ptr<crypto::RSAPrivateKey> client_private_key) {} | |
Ryan Sleevi
2015/03/19 04:38:24
It's not clear to me that this method is needed/ap
| |
245 | |
236 private: | 246 private: |
237 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); | 247 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); |
238 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 248 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. |
239 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 249 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
240 ConnectSignedCertTimestampsEnabledTLSExtension); | 250 ConnectSignedCertTimestampsEnabledTLSExtension); |
241 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 251 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
242 ConnectSignedCertTimestampsEnabledOCSP); | 252 ConnectSignedCertTimestampsEnabledOCSP); |
243 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 253 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
244 ConnectSignedCertTimestampsDisabled); | 254 ConnectSignedCertTimestampsDisabled); |
245 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 255 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
246 VerifyServerChainProperlyOrdered); | 256 VerifyServerChainProperlyOrdered); |
257 friend class SSLServerSocketTest; | |
247 | 258 |
248 // True if NPN was responded to, independent of selecting SPDY or HTTP. | 259 // True if NPN was responded to, independent of selecting SPDY or HTTP. |
249 bool was_npn_negotiated_; | 260 bool was_npn_negotiated_; |
250 // True if NPN successfully negotiated SPDY. | 261 // True if NPN successfully negotiated SPDY. |
251 bool was_spdy_negotiated_; | 262 bool was_spdy_negotiated_; |
252 // Protocol that we negotiated with the server. | 263 // Protocol that we negotiated with the server. |
253 NextProto protocol_negotiated_; | 264 NextProto protocol_negotiated_; |
254 // True if a channel ID was sent. | 265 // True if a channel ID was sent. |
255 bool channel_id_sent_; | 266 bool channel_id_sent_; |
256 // True if SCTs were received via a TLS extension. | 267 // True if SCTs were received via a TLS extension. |
257 bool signed_cert_timestamps_received_; | 268 bool signed_cert_timestamps_received_; |
258 // True if a stapled OCSP response was received. | 269 // True if a stapled OCSP response was received. |
259 bool stapled_ocsp_response_received_; | 270 bool stapled_ocsp_response_received_; |
260 // Protocol negotiation extension used. | 271 // Protocol negotiation extension used. |
261 SSLNegotiationExtension negotiation_extension_; | 272 SSLNegotiationExtension negotiation_extension_; |
262 }; | 273 }; |
263 | 274 |
264 } // namespace net | 275 } // namespace net |
265 | 276 |
266 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 277 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
OLD | NEW |