且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++/Win32 FTP安全性和使用SSL的基础

更新时间:2023-02-27 08:11:15

如果要查看FTP服务器是否以显式模式支持FTPS( RFC 4217 ),然后发送 AUTH TLS .如果它回答 5xx 错误代码,则不会.如果它以 234 答复,则它会这样做,并且您的客户端应该做出适当的反应(对于符合RFC 4217的服务器,这意味着进行标准的TLS握手).

If you want to see if a FTP server supports FTPS in explicit mode (RFC 2228, RFC 4217), then send an AUTH TLS. If it replies with a 5xx error code, then it doesn't; if it replies with a 234, then it does and your client should react appropriately (which, for a RFC 4217 compliant server, means doing a standard TLS handshake).

不幸的是,WinInet API不允许您执行此操作,因此您可能需要查看 libcurl ,即开即用地支持FTPS.

Unfortunately the WinInet API doesn't let you do this, so you might want to look at libcurl, which supports FTPS out of the box.