Skip to content
Snippets Groups Projects
Commit d7f2ab31 authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Forward-declare structs in GRPCSecureChannel.h

And add warning about using custom certificates or name override if not
testing.
parent 82fb883b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment