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 base::Bind(&NetLogX509CertificateCallback, | 825 CreateNetLogX509CertificateCallback(server_cert_)); |
826 base::Unretained(server_cert_.get()))); | |
827 GotoState(STATE_VERIFY_CERT); | 826 GotoState(STATE_VERIFY_CERT); |
828 } else { | 827 } else { |
829 int ssl_error = SSL_get_error(ssl_, rv); | 828 int ssl_error = SSL_get_error(ssl_, rv); |
830 net_error = MapOpenSSLError(ssl_error, err_tracer); | 829 net_error = MapOpenSSLError(ssl_error, err_tracer); |
831 | 830 |
832 // If not done, stay in this state | 831 // If not done, stay in this state |
833 if (net_error == ERR_IO_PENDING) { | 832 if (net_error == ERR_IO_PENDING) { |
834 GotoState(STATE_HANDSHAKE); | 833 GotoState(STATE_HANDSHAKE); |
835 } else { | 834 } else { |
836 LOG(ERROR) << "handshake failed; returned " << rv | 835 LOG(ERROR) << "handshake failed; returned " << rv |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1315 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
1317 user_write_buf_->data()); | 1316 user_write_buf_->data()); |
1318 return rv; | 1317 return rv; |
1319 } | 1318 } |
1320 | 1319 |
1321 int err = SSL_get_error(ssl_, rv); | 1320 int err = SSL_get_error(ssl_, rv); |
1322 return MapOpenSSLError(err, err_tracer); | 1321 return MapOpenSSLError(err, err_tracer); |
1323 } | 1322 } |
1324 | 1323 |
1325 } // namespace net | 1324 } // namespace net |
OLD | NEW |