| 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/ssl.h> | 10 #include <openssl/ssl.h> |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 } else if (rv == 1) { | 815 } else if (rv == 1) { |
| 816 if (trying_cached_session_ && logging::DEBUG_MODE) { | 816 if (trying_cached_session_ && logging::DEBUG_MODE) { |
| 817 DVLOG(2) << "Result of session reuse for " << host_and_port_.ToString() | 817 DVLOG(2) << "Result of session reuse for " << host_and_port_.ToString() |
| 818 << " is: " << (SSL_session_reused(ssl_) ? "Success" : "Fail"); | 818 << " is: " << (SSL_session_reused(ssl_) ? "Success" : "Fail"); |
| 819 } | 819 } |
| 820 // SSL handshake is completed. Let's verify the certificate. | 820 // SSL handshake is completed. Let's verify the certificate. |
| 821 const bool got_cert = !!UpdateServerCert(); | 821 const bool got_cert = !!UpdateServerCert(); |
| 822 DCHECK(got_cert); | 822 DCHECK(got_cert); |
| 823 net_log_.AddEvent( | 823 net_log_.AddEvent( |
| 824 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, | 824 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, |
| 825 make_scoped_refptr(new X509CertificateNetLogParam(server_cert_))); | 825 base::Bind(&NetLogX509CertificateCallback, |
| 826 base::Unretained(server_cert_.get()))); |
| 826 GotoState(STATE_VERIFY_CERT); | 827 GotoState(STATE_VERIFY_CERT); |
| 827 } else { | 828 } else { |
| 828 int ssl_error = SSL_get_error(ssl_, rv); | 829 int ssl_error = SSL_get_error(ssl_, rv); |
| 829 net_error = MapOpenSSLError(ssl_error, err_tracer); | 830 net_error = MapOpenSSLError(ssl_error, err_tracer); |
| 830 | 831 |
| 831 // If not done, stay in this state | 832 // If not done, stay in this state |
| 832 if (net_error == ERR_IO_PENDING) { | 833 if (net_error == ERR_IO_PENDING) { |
| 833 GotoState(STATE_HANDSHAKE); | 834 GotoState(STATE_HANDSHAKE); |
| 834 } else { | 835 } else { |
| 835 LOG(ERROR) << "handshake failed; returned " << rv | 836 LOG(ERROR) << "handshake failed; returned " << rv |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1316 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
| 1316 user_write_buf_->data()); | 1317 user_write_buf_->data()); |
| 1317 return rv; | 1318 return rv; |
| 1318 } | 1319 } |
| 1319 | 1320 |
| 1320 int err = SSL_get_error(ssl_, rv); | 1321 int err = SSL_get_error(ssl_, rv); |
| 1321 return MapOpenSSLError(err, err_tracer); | 1322 return MapOpenSSLError(err, err_tracer); |
| 1322 } | 1323 } |
| 1323 | 1324 |
| 1324 } // namespace net | 1325 } // namespace net |
| OLD | NEW |