I have a very similar challenge. I am working on extending a legacy FTP BSD/POSIX/UNIX sockets client code base (not libcurl) with RFC4217 "Secure FTP with TLS" support using Network.framework.
The first step in that effort was abstracting away BSD/POSIX/UNIX sockets into a FTP channel abstraction. I created a TCP channel type to do so and have BSD/POSIX/UNIX sockets and Network.framework implementations working equally well with "clear" operations.
I then moved onto implementing the easier / simpler "implicit" TLS support for Network.framework with a new TLS channel abstraction. That was reasonably straightforward and works with some FTPS server implementations; however, the majority return "425: Cannot secure data connection - TLS session resumption required." when trying to secure the data channel.
I then moved onto implementing the more difficult "explicit" TLS support for Network.framework, based on the nw_framer_t pass-through approach intimated at this forum post. After some refinement for generalization, that worked well enough, at least for the "AUTH TLS" FTP command on the FTP control channel.
However, once again, when attempting to secure the data channel with the TCP w/ Opportunistic TLS channel type, many servers respond with same "425: Cannot secure data connection - TLS session resumption required." witnessed before with the implicit TLS channel type.
This forum thread seems the "freshest" on this topic and after surveying the macOS 14.7 "Sonoma" Network.framework documentation, I do not see any clear way to get the TLS session context or identifier from the secure FTP control channel to then pass and reuse for the secure FTP data channel.
Any insights or examples would be greatly appreciated.
Topic:
Privacy & Security
SubTopic:
General
Tags: