aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-06-28 06:50:58 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-06-28 10:25:05 -0700
commitbb54ae8073d7069808e4e34f3f13480704c9b55b (patch)
tree7add178888f491247dd32abe340e6b1e54da45c2 /src/objective-c/GRPCClient
parent866255ec29ab09ce59950d0c3580b18b92d4db25 (diff)
Add roots.pem bundle to the Bazel target, and use a better bundle name.
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCSecureChannel.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
index 0f6eece885..43a8bd539e 100644
--- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
@@ -43,8 +43,12 @@
dispatch_once(&loading, ^{
// Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
NSBundle *bundle = [NSBundle bundleForClass:self.class];
- NSString *certsPath = [bundle pathForResource:@"gRPC.bundle/roots" ofType:@"pem"];
+ NSString *certsPath = [bundle pathForResource:@"gRPCCertificates.bundle/roots" ofType:@"pem"];
+ NSAssert(certsPath.length,
+ @"gRPCCertificates.bundle/roots.pem not found under %@. This file, with the root "
+ "certificates, is needed to establish TLS (HTTPS) connections.", bundle.bundlePath);
NSData *certsData = [NSData dataWithContentsOfFile:certsPath];
+ NSAssert(certsData.length, @"No data read from %@", certsPath);
NSString *certsString = [[NSString alloc] initWithData:certsData encoding:NSUTF8StringEncoding];
kCredentials = grpc_ssl_credentials_create(certsString.UTF8String, NULL);
});