Add roots.pem bundle to the Bazel target, and use a better bundle name.

pull/2240/head
Jorge Canizales 10 years ago
parent 866255ec29
commit bb54ae8073
  1. 7
      BUILD
  2. 2
      gRPC.podspec
  3. 6
      src/objective-c/GRPCClient/private/GRPCSecureChannel.m
  4. 7
      templates/BUILD.template
  5. 2
      templates/gRPC.podspec.template

@ -1247,8 +1247,15 @@ objc_library(
objc_client_path + "/private/*.m",
]),
includes = [objc_path],
bundles = [":gRPCCertificates"],
deps = [
":grpc_objc",
":rx_library",
],
)
objc_bundle_library(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["etc/roots.pem"],
)

@ -520,7 +520,7 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
ss.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC

@ -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);
});

@ -193,8 +193,15 @@ objc_library(
objc_client_path + "/private/*.m",
]),
includes = [objc_path],
bundles = [":gRPCCertificates"],
deps = [
":grpc_objc",
":rx_library",
],
)
objc_bundle_library(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["etc/roots.pem"],
)

@ -137,7 +137,7 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
ss.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC

Loading…
Cancel
Save