使用 Qt 安全上传文件
我正在创建一个实用程序来备份用户的媒体文件。媒体不被共享等,它只是一个备份实用程序。
我正在尝试寻找最好的方法来保护用户免受 ISP 指控他们通过使用某种安全连接下载非法媒体文件的影响。
该实用程序是使用 Qt 库用 C++ 编写的,到目前为止我只能找到用于安全连接的 QtSslSocket 组件。该域已拥有未来几年有效的 SSL 证书。
任何人都可以建议从服务器端和客户端实现这一点的最佳方法。即服务器需要具备什么?备份实用程序需要从客户端实施什么特别的措施来确保交易安全?
是否有任何已知的、稳定的 sftp 或 ftps 服务器可用等?
据我所知,Qt 不支持安全 FTP 传输。 不确定还有什么其他信息。使问题更加清晰将会很有用,但任何为我指明正确方向的建议或帮助都将受到欢迎。
编辑 我也精通 Java,所以 Java 解决方案也可以工作......
I'm in the process of creating a utility to backup user's media files. The media isn't being shared etc its only a backup utility.
I'm trying to think of the best way to protect users from ISPs accusing them of downloading illegal media files by using some sort of secure connection.
The utility is written in C++ using the Qt lib and so far I've only been able to find the QtSslSocket component for secure connections. The domain already has a valid SSL certificate for the next few years.
Can anyone suggest the best way to go about implementing this from both the server and client side. i.e what does the server need to have in place and is there anything in particular the backup utility needs to implement from the client side to ensure secure transactions?
Are there any known, stable sftp or ftps servers available etc?
As far as I know, Qt doesn't have support for secure FTP transfers.
Not sure what other info. would be useful to make the question any clearer but any advice or help pointing me in the right direction will be most welcomed.
EDIT I'm also Java competent so a Java solution will work just as well...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如马丁所写,你可以包装客户端。但如果您不想这样做,可以使用 libssh。
As Martin wrote, you can wrap client. But if you don't want to do that, you can use libssh.
我花了几天时间寻找某种解决方案,然后忘记了这个问题。然后今天我在 Qt-Creator 源代码中偶然发现了这个小宝石 Utils::ssh,包括对 SFTP、普通 SSH 和各种好东西的支持。
从 Qt-Creator 中解开一些东西可能会很痛苦,但是经历了这个过程就相当于获取了 Botan(QT-Creator 中的其他库之一)+ Utils。
当下雨的时候,倾盆大雨,我在一小时内找到了解决这个问题的两个解决方案 - http://nullget.sourceforge.net/ (需要中文翻译),但从他们的总结来看:
I searched for some sort of solution to this for a couple days and then forgot about the problem. Then today I stumbled across this little gem in the Qt-Creator source Utils::ssh, includes support for SFTP, plain-old SSH, and all sorts of goodies.
Disentangling stuff from Qt-Creator can be a pain, but having gone through this process it amounts to grabbing Botan (one of the other libs in QT-Creator) + Utils.
When it rains, it pours, I find two solutions to this problem in an hour - http://nullget.sourceforge.net/ (Requires Chinese translation), but from their summary:
最简单的方法是将 命令行 sftp 客户端 包装为一个 Qt 前端。
在服务器上,任何 ftp 服务器都应该可以开箱即用地执行 sftp。
Easiest way would be to just wrap a commandline sftp client with a Qt front end.
On the server any ftp server should do sftp pretty much out of the box.
正如 Synthesizerpatel 所说,Qt Creator 实现了 SFTP。因此,我隔离了包含 SSH 和 SFTP 的库,并在 Github 中创建了一个名为 QSsh 的新项目( https://github.com/lvklabs/QSsh)。该项目的目标是为任何 Qt 应用程序提供 SSH 和 SFTP 支持。
我在
examples/SecureUploader/
中编写了一个有关如何使用 SFTP 上传文件的示例,希望对您有所帮助
As Synthesizerpatel says Qt Creator implements SFTP. So I have isolated the library that contains SSH and SFTP and I have created a new project named QSsh in Github (https://github.com/lvklabs/QSsh). The aim of the project is to provide SSH and SFTP support for any Qt Application.
I have written an example on how to upload a file using SFTP in
examples/SecureUploader/
I hope it might be helpful