我正在使用 react_native_mqtt 并且需要在客户端和服务器之间实现安全的 mqtt 通信 [英] I'm working with react_native_mqtt and need to implement secure mqtt communication between client and sever

查看:26
本文介绍了我正在使用 react_native_mqtt 并且需要在客户端和服务器之间实现安全的 mqtt 通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在连接到 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆