I am using swift-nio-ssl and I need to renegotiate or reestablish TLS from the client side if the server sends a specific flag. Is there any way to do this (ideally from within a ChannelHandler)?
It's possible to achieve this in python using socket.detach()
and then wrap the returned socket with a new ssl socket using wrap_socket
.
I've found NIORenegotiationSupport
in the TLSConfiguration
already, but that seems to be triggered only if the server initiates the renegotiation from my understanding. (And I guess what I need is not really renegotiation, but I am not sure about it)
https://swiftpackageindex.com/apple/swift-nio-ssl/2.25.0/documentation/niossl/tlsconfiguration/renegotiationsupport
I hope what I'm trying to achieve is understandable, If not, please ask follow up questions