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

Side by Side Diff: net/test/test_server_win.cc

Issue 4646001: Implement LoadTemporaryRoot for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/net/base
Patch Set: New Win method & unittests Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wincrypt.h> 8 #include <wincrypt.h>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return false; 179 return false;
180 180
181 // If not enough bytes were read, fail. 181 // If not enough bytes were read, fail.
182 if (bytes_read < bytes_max) 182 if (bytes_read < bytes_max)
183 return false; 183 return false;
184 184
185 host_port_pair_.set_port(port); 185 host_port_pair_.set_port(port);
186 return true; 186 return true;
187 } 187 }
188 188
189 bool TestServer::CheckCATrusted() {
190 HCERTSTORE cert_store = CertOpenSystemStore(NULL, L"ROOT");
191 if (!cert_store) {
192 LOG(ERROR) << " could not open trusted root CA store";
193 return false;
194 }
195 PCCERT_CONTEXT cert =
196 CertFindCertificateInStore(cert_store,
197 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
198 0,
199 CERT_FIND_ISSUER_STR,
200 L"Test CA",
201 NULL);
202 if (cert)
203 CertFreeCertificateContext(cert);
204 CertCloseStore(cert_store, 0);
205
206 if (!cert) {
207 LOG(ERROR) << " TEST CONFIGURATION ERROR: you need to import the test ca "
208 "certificate to your trusted roots for this test to work. "
209 "For more info visit:\n"
210 "http://dev.chromium.org/developers/testing\n";
211 return false;
212 }
213
214 return true;
215 }
216
217 } // namespace net 189 } // namespace net
OLDNEW
« net/data/ssl/certificates/root_ca_cert.crt ('K') | « net/test/test_server_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698