| 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 "jingle/glue/xmpp_client_socket_factory.h" | 5 #include "jingle/glue/xmpp_client_socket_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "jingle/glue/fake_ssl_client_socket.h" | 10 #include "jingle/glue/fake_ssl_client_socket.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 return (use_fake_ssl_client_socket_ | 41 return (use_fake_ssl_client_socket_ |
| 42 ? std::unique_ptr<net::StreamSocket>( | 42 ? std::unique_ptr<net::StreamSocket>( |
| 43 new FakeSSLClientSocket(std::move(transport_socket))) | 43 new FakeSSLClientSocket(std::move(transport_socket))) |
| 44 : std::move(transport_socket)); | 44 : std::move(transport_socket)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 std::unique_ptr<net::SSLClientSocket> | 47 std::unique_ptr<net::SSLClientSocket> |
| 48 XmppClientSocketFactory::CreateSSLClientSocket( | 48 XmppClientSocketFactory::CreateSSLClientSocket( |
| 49 std::unique_ptr<net::ClientSocketHandle> transport_socket, | 49 std::unique_ptr<net::ClientSocketHandle> transport_socket, |
| 50 const net::HostPortPair& host_and_port) { | 50 const net::HostPortPair& host_and_port) { |
| 51 net::SSLClientSocketContext context; | 51 const net::URLRequestContext* url_context = |
| 52 context.cert_verifier = | 52 request_context_getter_->GetURLRequestContext(); |
| 53 request_context_getter_->GetURLRequestContext()->cert_verifier(); | 53 net::SSLClientSocketContext context( |
| 54 context.transport_security_state = request_context_getter_-> | 54 url_context->cert_verifier(), |
| 55 GetURLRequestContext()->transport_security_state(); | 55 nullptr, /* TODO(rkn): ChannelIDService is not thread safe. */ |
| 56 DCHECK(context.transport_security_state); | 56 url_context->transport_security_state(), |
| 57 // TODO(rkn): context.channel_id_service is NULL because the | 57 url_context->cert_transparency_verifier(), |
| 58 // ChannelIDService class is not thread safe. | 58 url_context->ct_policy_enforcer(), |
| 59 std::string() /* TODO(rsleevi): Ensure a proper unique shard. */); |
| 59 return client_socket_factory_->CreateSSLClientSocket( | 60 return client_socket_factory_->CreateSSLClientSocket( |
| 60 std::move(transport_socket), host_and_port, ssl_config_, context); | 61 std::move(transport_socket), host_and_port, ssl_config_, context); |
| 61 } | 62 } |
| 62 | 63 |
| 63 | 64 |
| 64 } // namespace jingle_glue | 65 } // namespace jingle_glue |
| OLD | NEW |