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 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/err.h> | 10 #include <openssl/err.h> |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 next_handshake_state_(STATE_NONE), | 359 next_handshake_state_(STATE_NONE), |
360 npn_status_(kNextProtoUnsupported), | 360 npn_status_(kNextProtoUnsupported), |
361 channel_id_request_return_value_(ERR_UNEXPECTED), | 361 channel_id_request_return_value_(ERR_UNEXPECTED), |
362 channel_id_xtn_negotiated_(false), | 362 channel_id_xtn_negotiated_(false), |
363 net_log_(transport_->socket()->NetLog()) {} | 363 net_log_(transport_->socket()->NetLog()) {} |
364 | 364 |
365 SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() { | 365 SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() { |
366 Disconnect(); | 366 Disconnect(); |
367 } | 367 } |
368 | 368 |
369 // The cache key consists of a host_and_port concatenated with a session | |
370 // cache shard. | |
wtc
2014/06/26 17:48:17
Nit: A comment at this location usually describes
| |
371 bool SSLClientSocketOpenSSL::InSessionCache() const { | |
372 SSLContext* context = SSLContext::GetInstance(); | |
373 std::string cache_key = GetSocketSessionCacheKey(*this); | |
374 return context->session_cache()->SSLSessionIsInCache(cache_key); | |
375 } | |
376 | |
369 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( | 377 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( |
370 SSLCertRequestInfo* cert_request_info) { | 378 SSLCertRequestInfo* cert_request_info) { |
371 cert_request_info->host_and_port = host_and_port_; | 379 cert_request_info->host_and_port = host_and_port_; |
372 cert_request_info->cert_authorities = cert_authorities_; | 380 cert_request_info->cert_authorities = cert_authorities_; |
373 cert_request_info->cert_key_types = cert_key_types_; | 381 cert_request_info->cert_key_types = cert_key_types_; |
374 } | 382 } |
375 | 383 |
376 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto( | 384 SSLClientSocket::NextProtoStatus SSLClientSocketOpenSSL::GetNextProto( |
377 std::string* proto, std::string* server_protos) { | 385 std::string* proto, std::string* server_protos) { |
378 *proto = npn_proto_; | 386 *proto = npn_proto_; |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 DVLOG(2) << "next protocol: '" << npn_proto_ << "' status: " << npn_status_; | 1438 DVLOG(2) << "next protocol: '" << npn_proto_ << "' status: " << npn_status_; |
1431 return SSL_TLSEXT_ERR_OK; | 1439 return SSL_TLSEXT_ERR_OK; |
1432 } | 1440 } |
1433 | 1441 |
1434 scoped_refptr<X509Certificate> | 1442 scoped_refptr<X509Certificate> |
1435 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { | 1443 SSLClientSocketOpenSSL::GetUnverifiedServerCertificateChain() const { |
1436 return server_cert_; | 1444 return server_cert_; |
1437 } | 1445 } |
1438 | 1446 |
1439 } // namespace net | 1447 } // namespace net |
OLD | NEW |