向开源应用程序添加 SSL 支持

发布于 2024-09-15 16:17:22 字数 198 浏览 6 评论 0原文

我需要 Mosquitto http://mosquitto.org 才能使用 SSL。 我已经阅读了几个 OpenSSL 的示例,但由于我从未使用过 C 中的套接字,有人可以告诉我必须对现有套接字进行哪些更改吗? (接受、写、读?)

非常感谢

I need Mosquitto http://mosquitto.org to work with SSL.
I've read several examples with OpenSSL, but as I've never worked with sockets in C, can someone tell me what do I have to change for my existing sockets? (Accept, write, read?)

Thank you very much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃兔兔 2024-09-22 16:17:22

我的理解是,在调用accept()之后,您必须配置套接字以与OpenSSL一起使用——假设您也已经配置了要使用的库。

之后,您可以使用 SSL_read() 和 SSL_write() 代替 read() 和 write()。

当您想要关闭套接字时,您需要在调用 close() 之前禁用 SSL 支持。

这确实是一个合理的承诺 - 套接字代码并不是真正的问题,它了解您需要做什么来启动和停止 TLS 支持,并确保您不会错过可能导致漏洞的某些内容。

My understanding is that after you've called accept(), you then have to configure the socket for use with OpenSSL - assuming you've also already configured the library for use as well.

After that, you can use SSL_read() and SSL_write() instead of read() and write().

When you want to close the socket, you need to disable SSL support before calling close().

It's a reasonable undertaking for certain - the socket code isn't really the problem, it's understanding what you need to do to start and stop the TLS support and ensuring that you don't miss something out which could lead to vulnerabilities.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文