Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: net/tools/quic/quic_client_bin.cc

Issue 1454993002: QUIC - Code to verify SCT tag with certificate transparency verifier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, sends a request to the provided URL, and 6 // Connects to a host using QUIC, sends a request to the provided URL, and
7 // displays the response. 7 // displays the response.
8 // 8 //
9 // Some usage examples: 9 // Some usage examples:
10 // 10 //
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 // For secure QUIC we need to verify the cert chain. 236 // For secure QUIC we need to verify the cert chain.
237 scoped_ptr<CertVerifier> cert_verifier(CertVerifier::CreateDefault()); 237 scoped_ptr<CertVerifier> cert_verifier(CertVerifier::CreateDefault());
238 if (line->HasSwitch("disable-certificate-verification")) { 238 if (line->HasSwitch("disable-certificate-verification")) {
239 cert_verifier.reset(new FakeCertVerifier()); 239 cert_verifier.reset(new FakeCertVerifier());
240 } 240 }
241 scoped_ptr<TransportSecurityState> transport_security_state( 241 scoped_ptr<TransportSecurityState> transport_security_state(
242 new TransportSecurityState); 242 new TransportSecurityState);
243 transport_security_state.reset(new TransportSecurityState); 243 transport_security_state.reset(new TransportSecurityState);
244 ProofVerifierChromium* proof_verifier = new ProofVerifierChromium( 244 ProofVerifierChromium* proof_verifier = new ProofVerifierChromium(
245 cert_verifier.get(), nullptr, transport_security_state.get()); 245 cert_verifier.get(), nullptr, transport_security_state.get(), nullptr);
Ryan Hamilton 2015/11/18 20:57:27 Can we use a real CTVerifier?
ramant (doing other things) 2015/11/21 00:27:03 Done.
246 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id, 246 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id,
247 versions, &epoll_server, proof_verifier); 247 versions, &epoll_server, proof_verifier);
248 client.set_initial_max_packet_length( 248 client.set_initial_max_packet_length(
249 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize); 249 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize);
250 if (!client.Initialize()) { 250 if (!client.Initialize()) {
251 cerr << "Failed to initialize client." << endl; 251 cerr << "Failed to initialize client." << endl;
252 return 1; 252 return 1;
253 } 253 }
254 if (!client.Connect()) { 254 if (!client.Connect()) {
255 net::QuicErrorCode error = client.session()->error(); 255 net::QuicErrorCode error = client.session()->error();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 return 0; 321 return 0;
322 } else { 322 } else {
323 cout << "Request failed (redirect " << response_code << ")." << endl; 323 cout << "Request failed (redirect " << response_code << ")." << endl;
324 return 1; 324 return 1;
325 } 325 }
326 } else { 326 } else {
327 cerr << "Request failed (" << response_code << ")." << endl; 327 cerr << "Request failed (" << response_code << ")." << endl;
328 return 1; 328 return 1;
329 } 329 }
330 } 330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698