首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mosquitto加密无效

mosquitto加密无效
EN

Stack Overflow用户
提问于 2018-05-03 09:04:26
回答 1查看 1.3K关注 0票数 3

我正试图建立一个PSK加密桥连接蚊子遵循教程。我用的是两个码头集装箱。一个是桥梁,另一个是服务器。他们都在不同的电脑上。在没有加密的情况下,连接工作正常。对于订阅主题,我使用的是节点红色。

这是服务器的配置文件:

代码语言:javascript
复制
port 1883

persistence true
persistence_location /mosquitto/data/
#persistence_file mosquitto.db
#cleansession false
#clientid nodered

listener 8883
psk_hint broker-server
psk_file /mosquitto/certs/psk_file.txt

log_type all
log_dest file /mosquitto/log/mosquitto.log
connection_messages true
log_timestamp true
allow_anonymous true
#password_file /mosquitto/config/passwd

为了连接桥,我必须要文件。

mosquitto.conf:

代码语言:javascript
复制
#include_dir /etc/mosquitto/conf.d

# GENERAL CONFIGURATION BROKER
# ----------------------------------------------------------------
pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/


log_type all
log_dest file /etc/mosquitto/log/mosquitto.log

include_dir /etc/mosquitto/bridges

# ----------------------------------------------------------------
# SECURITY (comm. Nordic -> RPI): Password

#password_file /etc/mosquitto/passwd
allow_anonymous true

和bridge.conf:

代码语言:javascript
复制
# =================================================================
# Bridges to Node Red
# =================================================================

# IP address
#connection client-bridgeport
connection bridge-01
address 192.168.1.34:8883
bridge_identity bridgeport
bridge_psk 123456789987654321

# -----------------------------------------------------------------
# TOPICS
topic # out 1 ""
topic # in 1 ""

# ------------------------------------------------------------------

# Setting protocol version explicitly
#bridge_protocol_version mqttv311
#bridge_insecure false

# Bridge connection name and MQTT client Id,
# enabling the connection automatically when the broker starts.
cleansession false
remote_clientid broker-server
start_type automatic
#notifications false
log_type all

在服务器的日志文件中,我可以看到以下错误:

客户端的套接字错误未知,断开连接。

在桥连接中,我看到以下错误:

网桥代理服务器发送连接套接字错误的客户端local.broker-server,断开连接。

我不知道我做错了什么。如果我删除加密,一切正常。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-07 08:38:04

看来,码头枢纽中蚊虫的默认码头容器并没有将psk加密包含在mosquitto中,如 post所示。

我不得不建立自己的形象安装蚊子如下:

代码语言:javascript
复制
RUN apt-get -y update && \
    apt-get -y install mosquitto mosquitto-clients
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50151028

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档