I presume that the SNI is being set from the host name you used to construct the NWHostEndpoint that you passed to
-createTCPConnectionToEndpoint:enableTLS:TLSParameters:delegate:
. So it’s not a question of setting the SNI, but setting it to something other than the default. Is that right?
If so, then yeah, I believe you are out of luck here. I’d appreciate you filing an enhancement request for support for that. Please post your bug number, just for the record.
There’s no good way to work around this within the confines of NWTCPConnection but there’s also no requirement to use NWTCPConnection in your provider. You’re free to use whatever transport and TLS implementation you like, including BSD Sockets + Secure Transport or CFSocketStream (via the NSStream API).
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"