From d7f2ab31258a0972eb08e9fac0cac5b64b2a7919 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Wed, 5 Aug 2015 17:38:00 -0700 Subject: [PATCH] Forward-declare structs in GRPCSecureChannel.h And add warning about using custom certificates or name override if not testing. --- src/objective-c/GRPCClient/private/GRPCSecureChannel.h | 5 ++++- src/objective-c/GRPCClient/private/GRPCSecureChannel.m | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.h b/src/objective-c/GRPCClient/private/GRPCSecureChannel.h index 8b259c8dada..ca8780ee8be 100644 --- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.h +++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.h @@ -31,13 +31,16 @@ * */ -#import +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; diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m index eb3cfc40eb0..92421df9c54 100644 --- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m +++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m @@ -33,6 +33,8 @@ #import "GRPCSecureChannel.h" +#import + static grpc_credentials *CertificatesAtPath(NSString *path) { NSData *certsData = [NSData dataWithContentsOfFile:path]; NSCAssert(certsData.length, @"No data read from %@", path);