File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,14 @@ public class Channel {
6767 /// - Parameter address: the address of the server to be called
6868 public init ( address: String , certificates: String ? , host: String ? ) {
6969 self . host = address
70- if certificates == nil {
70+ if let certificates = certificates {
71+ underlyingChannel = cgrpc_channel_create_secure ( address, certificates, host)
72+ } else {
7173 let bundle = Bundle ( for: Channel . self)
7274 let url = bundle. url ( forResource: " roots " , withExtension: " pem " ) !
7375 let data = try ! Data ( contentsOf: url)
7476 let s = String ( data: data, encoding: . ascii)
7577 underlyingChannel = cgrpc_channel_create_secure ( address, s, host)
76- } else {
77- underlyingChannel = cgrpc_channel_create_secure ( address, certificates, host)
7878 }
7979 completionQueue = CompletionQueue ( underlyingCompletionQueue: cgrpc_channel_completion_queue ( underlyingChannel) )
8080 completionQueue. name = " Client " // only for debugging
You can’t perform that action at this time.
0 commit comments