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 "net/tools/cert_verify_tool/verify_using_path_builder.h" | 5 #include "net/tools/cert_verify_tool/verify_using_path_builder.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // TODO(mattm): add command line flags to configure using CertIssuerSourceAia | 221 // TODO(mattm): add command line flags to configure using CertIssuerSourceAia |
222 // (similar to VERIFY_CERT_IO_ENABLED flag for CertVerifyProc). | 222 // (similar to VERIFY_CERT_IO_ENABLED flag for CertVerifyProc). |
223 net::URLRequestContextBuilder url_request_context_builder; | 223 net::URLRequestContextBuilder url_request_context_builder; |
224 url_request_context_builder.set_user_agent(GetUserAgent()); | 224 url_request_context_builder.set_user_agent(GetUserAgent()); |
225 #if defined(OS_LINUX) | 225 #if defined(OS_LINUX) |
226 // On Linux, use a fixed ProxyConfigService, since the default one | 226 // On Linux, use a fixed ProxyConfigService, since the default one |
227 // depends on glib. | 227 // depends on glib. |
228 // | 228 // |
229 // TODO(akalin): Remove this once http://crbug.com/146421 is fixed. | 229 // TODO(akalin): Remove this once http://crbug.com/146421 is fixed. |
230 url_request_context_builder.set_proxy_config_service( | 230 url_request_context_builder.set_proxy_config_service( |
231 base::WrapUnique(new net::ProxyConfigServiceFixed(net::ProxyConfig()))); | 231 base::MakeUnique<net::ProxyConfigServiceFixed>(net::ProxyConfig())); |
232 #endif | 232 #endif |
233 std::unique_ptr<net::URLRequestContext> url_request_context = | 233 std::unique_ptr<net::URLRequestContext> url_request_context = |
234 url_request_context_builder.Build(); | 234 url_request_context_builder.Build(); |
235 net::CertNetFetcherImpl cert_net_fetcher(url_request_context.get()); | 235 net::CertNetFetcherImpl cert_net_fetcher(url_request_context.get()); |
236 net::CertIssuerSourceAia aia_cert_issuer_source(&cert_net_fetcher); | 236 net::CertIssuerSourceAia aia_cert_issuer_source(&cert_net_fetcher); |
237 path_builder.AddCertIssuerSource(&aia_cert_issuer_source); | 237 path_builder.AddCertIssuerSource(&aia_cert_issuer_source); |
238 | 238 |
239 net::TestClosure callback; | 239 net::TestClosure callback; |
240 net::CompletionStatus rv = path_builder.Run(callback.closure()); | 240 net::CompletionStatus rv = path_builder.Run(callback.closure()); |
241 | 241 |
(...skipping 18 matching lines...) Expand all Loading... |
260 if (!DumpParsedCertificateChain( | 260 if (!DumpParsedCertificateChain( |
261 dump_prefix_path.AddExtension( | 261 dump_prefix_path.AddExtension( |
262 FILE_PATH_LITERAL(".CertPathBuilder.pem")), | 262 FILE_PATH_LITERAL(".CertPathBuilder.pem")), |
263 result.paths[result.best_result_index]->path)) { | 263 result.paths[result.best_result_index]->path)) { |
264 return false; | 264 return false; |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 return result.HasValidPath(); | 268 return result.HasValidPath(); |
269 } | 269 } |
OLD | NEW |