grpc / grpc-swift

The Swift language implementation of gRPC.
Apache License 2.0
2.04k stars 420 forks source link

Specify TLS Provider for Swift gRPC Client Connection #1561

Open WiseNN opened 1 year ago

WiseNN commented 1 year ago

What are you trying to achieve?

Is it possible to use Swift gRPC with a custom TLS provider? (like openSSL v3?). The objective is to use a custom TLS provider that will work with the Swift gRPC framework. Has anyone done this before.

What have you tried so far?

I found a SO post that looks like someone may have been able to do this in C++.

I am looking to see if something similar is offered in this framework. Not sure if I post this question here or the Swift NIO SSL repository.

Lukasa commented 1 year ago

Currently this isn't supported, but it's certainly possible. So long as the TLS backend exposes a NIO ChannelHandler interface this should be workable.

WiseNN commented 1 year ago

Got it. Definitely appreciate the response @Lukasa . Do you mind providing an example of what that would look like?

Lukasa commented 1 year ago

In general it would look quite a lot like what swift-nio-ssl has already, rewritten for the OpenSSL backend. It should be easy enough to literally fork that code and rewrite the calls to fit OpenSSL 3.