我正在使用 react

编程入门 行业动态 更新时间:2024-10-28 16:27:34
本文介绍了我正在使用 react_native_mqtt 并且需要在客户端和服务器之间实现安全的 mqtt 通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

在连接到 mqtt 服务器时,我将 useSSL 设置为 true.正在使用 443 端口.

While connecting to the mqtt server I'm setting useSSL to true. 443 port is being used.

我需要在此调用中使用 SSL 固定,设置 useSSL 标志是否足够?

I need to use SSL pinning with this call, is setting useSSL flag enough?

如果没有,那么建议我使用 SSL 固定来安全连接服务器的方式.

If not then suggest me the way in which I can use SSL pinning to securely connect with the server.

我没有发现 react_native_mqtt 库中与证书固定相关的任何问题.

I didn't fine anything related to certificate pinning in the react_native_mqtt library.

此外,其中一个库建议使用节点的 tls.connect() 进行连接.如果有人用过这个,请分享.

Also, one of the libraries suggested to connect using node's tls.connect(). If anyone have used this ever please share.

谢谢

推荐答案

我也遇到了同样的问题,我做的是添加了addition field to connectclient.connect({ onSuccess: onConnect, useSSL: true ,userName:brokerUsername", password:brokerPassword" })它对我有用.

I was also facing the same problem, what I did was I added addition field to connect client.connect({ onSuccess: onConnect, useSSL: true ,userName:"brokerUsername", password:"brokerPassword" }) and it worked for me.

这篇关于我正在使用 react_native_mqtt 并且需要在客户端和服务器之间实现安全的 mqtt 通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 05:14:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1129070.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:react

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!