Forward-declare structs in GRPCSecureChannel.h

And add warning about using custom certificates or name override if not
testing.
pull/2754/head
Jorge Canizales 9 years ago
parent 82fb883bec
commit d7f2ab3125
  1. 5
      src/objective-c/GRPCClient/private/GRPCSecureChannel.h
  2. 2
      src/objective-c/GRPCClient/private/GRPCSecureChannel.m

@ -31,13 +31,16 @@
*
*/
#import <grpc/grpc_security.h>
struct grpc_credentials;
struct grpc_channel_args;
#import "GRPCChannel.h"
@interface GRPCSecureChannel : GRPCChannel
- (instancetype)initWithHost:(NSString *)host;
// Only in tests shouldn't pathToCertificates or hostNameOverride be nil. Passing nil for
// pathToCertificates results in using the default root certificates distributed with the library.
- (instancetype)initWithHost:(NSString *)host
pathToCertificates:(NSString *)path
hostNameOverride:(NSString *)hostNameOverride;

@ -33,6 +33,8 @@
#import "GRPCSecureChannel.h"
#import <grpc/grpc_security.h>
static grpc_credentials *CertificatesAtPath(NSString *path) {
NSData *certsData = [NSData dataWithContentsOfFile:path];
NSCAssert(certsData.length, @"No data read from %@", path);

Loading…
Cancel
Save