| 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 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" | 5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "crypto/secure_util.h" | 9 #include "crypto/secure_util.h" |
| 10 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 104 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
| 105 | 105 |
| 106 net::HostPortPair host_and_port(kSslFakeHostName, 0); | 106 net::HostPortPair host_and_port(kSslFakeHostName, 0); |
| 107 net::SSLClientSocketContext context; | 107 net::SSLClientSocketContext context; |
| 108 context.cert_verifier = cert_verifier_.get(); | 108 context.cert_verifier = cert_verifier_.get(); |
| 109 context.transport_security_state = transport_security_state_.get(); | 109 context.transport_security_state = transport_security_state_.get(); |
| 110 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); | 110 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); |
| 111 connection->SetSocket(socket.Pass()); | 111 connection->SetSocket(socket.Pass()); |
| 112 socket_ = | 112 socket_ = |
| 113 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 113 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 114 connection.Pass(), host_and_port, ssl_config, context); | 114 connection.Pass(), host_and_port, ssl_config, NULL, context); |
| 115 | 115 |
| 116 result = socket_->Connect( | 116 result = socket_->Connect( |
| 117 base::Bind(&SslHmacChannelAuthenticator::OnConnected, | 117 base::Bind(&SslHmacChannelAuthenticator::OnConnected, |
| 118 base::Unretained(this))); | 118 base::Unretained(this))); |
| 119 } | 119 } |
| 120 | 120 |
| 121 if (result == net::ERR_IO_PENDING) | 121 if (result == net::ERR_IO_PENDING) |
| 122 return; | 122 return; |
| 123 | 123 |
| 124 OnConnected(result); | 124 OnConnected(result); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 void SslHmacChannelAuthenticator::NotifyError(int error) { | 273 void SslHmacChannelAuthenticator::NotifyError(int error) { |
| 274 done_callback_.Run(static_cast<net::Error>(error), | 274 done_callback_.Run(static_cast<net::Error>(error), |
| 275 scoped_ptr<net::StreamSocket>()); | 275 scoped_ptr<net::StreamSocket>()); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace protocol | 278 } // namespace protocol |
| 279 } // namespace remoting | 279 } // namespace remoting |
| OLD | NEW |