| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/cast_channel/cast_socket.h" | 5 #include "chrome/browser/extensions/api/cast_channel/cast_socket.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // context object. | 128 // context object. |
| 129 context.cert_verifier = cert_verifier_.get(); | 129 context.cert_verifier = cert_verifier_.get(); |
| 130 context.transport_security_state = transport_security_state_.get(); | 130 context.transport_security_state = transport_security_state_.get(); |
| 131 | 131 |
| 132 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); | 132 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); |
| 133 connection->SetSocket(tcp_socket_.PassAs<net::StreamSocket>()); | 133 connection->SetSocket(tcp_socket_.PassAs<net::StreamSocket>()); |
| 134 net::HostPortPair host_and_port = net::HostPortPair::FromIPEndPoint( | 134 net::HostPortPair host_and_port = net::HostPortPair::FromIPEndPoint( |
| 135 ip_endpoint_); | 135 ip_endpoint_); |
| 136 | 136 |
| 137 return net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 137 return net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 138 connection.Pass(), host_and_port, ssl_config, context); | 138 connection.Pass(), host_and_port, ssl_config, NULL, context); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool CastSocket::ExtractPeerCert(std::string* cert) { | 141 bool CastSocket::ExtractPeerCert(std::string* cert) { |
| 142 DCHECK(cert); | 142 DCHECK(cert); |
| 143 DCHECK(peer_cert_.empty()); | 143 DCHECK(peer_cert_.empty()); |
| 144 net::SSLInfo ssl_info; | 144 net::SSLInfo ssl_info; |
| 145 if (!socket_->GetSSLInfo(&ssl_info) || !ssl_info.cert.get()) | 145 if (!socket_->GetSSLInfo(&ssl_info) || !ssl_info.cert.get()) |
| 146 return false; | 146 return false; |
| 147 bool result = net::X509Certificate::GetDEREncoded( | 147 bool result = net::X509Certificate::GetDEREncoded( |
| 148 ssl_info.cert->os_cert_handle(), cert); | 148 ssl_info.cert->os_cert_handle(), cert); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 io_buffer = new net::DrainableIOBuffer(new net::StringIOBuffer(message_data), | 670 io_buffer = new net::DrainableIOBuffer(new net::StringIOBuffer(message_data), |
| 671 message_data.size()); | 671 message_data.size()); |
| 672 return true; | 672 return true; |
| 673 } | 673 } |
| 674 | 674 |
| 675 CastSocket::WriteRequest::~WriteRequest() { } | 675 CastSocket::WriteRequest::~WriteRequest() { } |
| 676 | 676 |
| 677 } // namespace cast_channel | 677 } // namespace cast_channel |
| 678 } // namespace api | 678 } // namespace api |
| 679 } // namespace extensions | 679 } // namespace extensions |
| OLD | NEW |