OLD | NEW |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 if (!ParseServerData(server_data)) { | 211 if (!ParseServerData(server_data)) { |
212 LOG(ERROR) << "Could not parse server_data: " << server_data; | 212 LOG(ERROR) << "Could not parse server_data: " << server_data; |
213 return false; | 213 return false; |
214 } | 214 } |
215 | 215 |
216 return true; | 216 return true; |
217 } | 217 } |
218 | 218 |
219 bool TestServer::CheckCATrusted() { | |
220 HCERTSTORE cert_store = CertOpenSystemStore(NULL, L"ROOT"); | |
221 if (!cert_store) { | |
222 LOG(ERROR) << " could not open trusted root CA store"; | |
223 return false; | |
224 } | |
225 PCCERT_CONTEXT cert = | |
226 CertFindCertificateInStore(cert_store, | |
227 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, | |
228 0, | |
229 CERT_FIND_ISSUER_STR, | |
230 L"Test CA", | |
231 NULL); | |
232 if (cert) | |
233 CertFreeCertificateContext(cert); | |
234 CertCloseStore(cert_store, 0); | |
235 | |
236 if (!cert) { | |
237 LOG(ERROR) << " TEST CONFIGURATION ERROR: you need to import the test ca " | |
238 "certificate to your trusted roots for this test to work. " | |
239 "For more info visit:\n" | |
240 "http://dev.chromium.org/developers/testing\n"; | |
241 return false; | |
242 } | |
243 | |
244 return true; | |
245 } | |
246 | |
247 } // namespace net | 219 } // namespace net |
OLD | NEW |