Index: ios/web/web_state/ui/crw_web_controller_unittest.mm |
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm |
index 2f9a6c94872164b3bc2d181c35beab9f8ddb6188..69a0c6080b902831714f4f8394142a65d0ff6db0 100644 |
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm |
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm |
@@ -38,6 +38,7 @@ |
#import "ios/web/web_state/web_state_impl.h" |
#import "ios/web/web_state/wk_web_view_security_util.h" |
#import "net/base/mac/url_conversions.h" |
+#include "net/cert/x509_util_ios_and_mac.h" |
#include "net/ssl/ssl_info.h" |
#include "net/test/cert_test_util.h" |
#include "net/test/test_data_directory.h" |
@@ -189,14 +190,18 @@ TEST_F(CRWWebControllerTest, SslCertError) { |
scoped_refptr<net::X509Certificate> cert = |
net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); |
+ ASSERT_TRUE(cert); |
+ base::ScopedCFTypeRef<CFMutableArrayRef> chain( |
+ net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get())); |
+ ASSERT_TRUE(chain); |
- NSArray* chain = @[ static_cast<id>(cert->os_cert_handle()) ]; |
GURL url("https://chromium.test"); |
NSError* error = |
[NSError errorWithDomain:NSURLErrorDomain |
code:NSURLErrorServerCertificateHasUnknownRoot |
userInfo:@{ |
- web::kNSErrorPeerCertificateChainKey : chain, |
+ web::kNSErrorPeerCertificateChainKey : |
+ static_cast<NSArray*>(chain.get()), |
web::kNSErrorFailingURLKey : net::NSURLWithGURL(url), |
}]; |
base::scoped_nsobject<NSObject> navigation([[NSObject alloc] init]); |