| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "blimp/net/ssl_client_transport.h" | 5 #include "blimp/net/ssl_client_transport.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "blimp/net/exact_match_cert_verifier.h" | 9 #include "blimp/net/exact_match_cert_verifier.h" |
| 10 #include "blimp/net/stream_socket_connection.h" | 10 #include "blimp/net/stream_socket_connection.h" |
| 11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
| 12 #include "net/cert/x509_certificate.h" | 12 #include "net/cert/x509_certificate.h" |
| 13 #include "net/socket/client_socket_factory.h" | 13 #include "net/socket/client_socket_factory.h" |
| 14 #include "net/socket/client_socket_handle.h" | 14 #include "net/socket/client_socket_handle.h" |
| 15 #include "net/socket/ssl_client_socket.h" | 15 #include "net/socket/ssl_client_socket.h" |
| 16 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
| 17 #include "net/socket/tcp_client_socket.h" | 17 #include "net/socket/tcp_client_socket.h" |
| 18 #include "net/ssl/ssl_config.h" | 18 #include "net/ssl/ssl_config.h" |
| 19 | 19 |
| 20 namespace blimp { | 20 namespace blimp { |
| 21 | 21 |
| 22 SSLClientTransport::SSLClientTransport(const net::IPEndPoint& ip_endpoint, | 22 SSLClientTransport::SSLClientTransport(const net::IPEndPoint& ip_endpoint, |
| 23 scoped_refptr<net::X509Certificate> cert, | 23 scoped_refptr<net::X509Certificate> cert, |
| 24 BlimpConnectionStatistics* statistics, |
| 24 net::NetLog* net_log) | 25 net::NetLog* net_log) |
| 25 : TCPClientTransport(ip_endpoint, net_log), ip_endpoint_(ip_endpoint) { | 26 : TCPClientTransport(ip_endpoint, statistics, net_log), |
| 27 ip_endpoint_(ip_endpoint) { |
| 26 // Test code may pass in a null value for |cert|. Only spin up a CertVerifier | 28 // Test code may pass in a null value for |cert|. Only spin up a CertVerifier |
| 27 // if there is a cert present. | 29 // if there is a cert present. |
| 28 if (cert) { | 30 if (cert) { |
| 29 cert_verifier_.reset(new ExactMatchCertVerifier(std::move(cert))); | 31 cert_verifier_.reset(new ExactMatchCertVerifier(std::move(cert))); |
| 30 } | 32 } |
| 31 } | 33 } |
| 32 | 34 |
| 33 SSLClientTransport::~SSLClientTransport() {} | 35 SSLClientTransport::~SSLClientTransport() {} |
| 34 | 36 |
| 35 const char* SSLClientTransport::GetName() const { | 37 const char* SSLClientTransport::GetName() const { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 85 } |
| 84 | 86 |
| 85 void SSLClientTransport::OnSSLConnectComplete(int result) { | 87 void SSLClientTransport::OnSSLConnectComplete(int result) { |
| 86 DCHECK_NE(net::ERR_IO_PENDING, result); | 88 DCHECK_NE(net::ERR_IO_PENDING, result); |
| 87 DVLOG(1) << "SSL connection result=" << result; | 89 DVLOG(1) << "SSL connection result=" << result; |
| 88 | 90 |
| 89 OnConnectComplete(result); | 91 OnConnectComplete(result); |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace blimp | 94 } // namespace blimp |
| OLD | NEW |