| 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" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // inadequate TLS version. | 220 // inadequate TLS version. |
| 221 static bool IsTLSVersionAdequateForHTTP2(const SSLConfig& ssl_config); | 221 static bool IsTLSVersionAdequateForHTTP2(const SSLConfig& ssl_config); |
| 222 | 222 |
| 223 // Serializes |next_protos| in the wire format for ALPN: protocols are listed | 223 // Serializes |next_protos| in the wire format for ALPN: protocols are listed |
| 224 // in order, each prefixed by a one-byte length. Any HTTP/2 protocols in | 224 // in order, each prefixed by a one-byte length. Any HTTP/2 protocols in |
| 225 // |next_protos| are ignored if |can_advertise_http2| is false. | 225 // |next_protos| are ignored if |can_advertise_http2| is false. |
| 226 static std::vector<uint8_t> SerializeNextProtos( | 226 static std::vector<uint8_t> SerializeNextProtos( |
| 227 const NextProtoVector& next_protos, | 227 const NextProtoVector& next_protos, |
| 228 bool can_advertise_http2); | 228 bool can_advertise_http2); |
| 229 | 229 |
| 230 // For unit testing only. | |
| 231 // Returns the unverified certificate chain as presented by server. | |
| 232 // Note that chain may be different than the verified chain returned by | |
| 233 // StreamSocket::GetSSLInfo(). | |
| 234 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | |
| 235 const = 0; | |
| 236 | |
| 237 private: | 230 private: |
| 238 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); | 231 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); |
| 239 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 232 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. |
| 240 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 233 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 241 ConnectSignedCertTimestampsEnabledTLSExtension); | 234 ConnectSignedCertTimestampsEnabledTLSExtension); |
| 242 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 235 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 243 ConnectSignedCertTimestampsEnabledOCSP); | 236 ConnectSignedCertTimestampsEnabledOCSP); |
| 244 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 237 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 245 ConnectSignedCertTimestampsDisabled); | 238 ConnectSignedCertTimestampsDisabled); |
| 246 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 239 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 258 bool signed_cert_timestamps_received_; | 251 bool signed_cert_timestamps_received_; |
| 259 // True if a stapled OCSP response was received. | 252 // True if a stapled OCSP response was received. |
| 260 bool stapled_ocsp_response_received_; | 253 bool stapled_ocsp_response_received_; |
| 261 // Protocol negotiation extension used. | 254 // Protocol negotiation extension used. |
| 262 SSLNegotiationExtension negotiation_extension_; | 255 SSLNegotiationExtension negotiation_extension_; |
| 263 }; | 256 }; |
| 264 | 257 |
| 265 } // namespace net | 258 } // namespace net |
| 266 | 259 |
| 267 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 260 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |