aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m b/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m
index d27f7ca565..070a529629 100644
--- a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m
@@ -38,7 +38,13 @@
@implementation GRPCUnsecuredChannel
- (instancetype)initWithHost:(NSString *)host {
- return (self = [super initWithChannel:grpc_channel_create(host.UTF8String, NULL)]);
+ return (self = [super initWithChannel:grpc_insecure_channel_create(host.UTF8String, NULL)]);
}
+// TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers
+// for GRPCChannel. Move them into GRPCChannel, which will make the following unnecessary.
+- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
+ [NSException raise:NSInternalInconsistencyException format:@"use the other initializer"];
+ return [self initWithHost:nil]; // silence warnings
+}
@end