File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,12 @@ openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out s
57
57
58
58
现在配置/etc/mosquitto/mosquitto.conf,确保8883端口的设置如下:
59
59
60
- ` listener 8883cafile /etc/mosquitto/tls/ca.crtcertfile /etc/mosquitto/tls/server.crtkeyfile /etc/mosquitto/tls/server.key `
60
+ ``` conf
61
+ listener 8883
62
+ cafile /etc/mosquitto/tls/ca.crt
63
+ certfile /etc/mosquitto/tls/server.crt
64
+ keyfile /etc/mosquitto/tls/server.key
65
+ ```
61
66
62
67
重启Mosquitto服务就可以用以下命令订阅和发布消息了,当然所有消息都由TLS加密,可以无忧无虑地传递私密信息啦:
63
68
@@ -151,7 +156,13 @@ openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out c
151
156
152
157
现在配置/etc/mosquitto/mosquitto.conf,确保8883端口的设置如下:
153
158
154
- ` listener 8883cafile /etc/mosquitto/tls/ca.crtcertfile /etc/mosquitto/tls/server.crtkeyfile /etc/mosquitto/tls/server.keyrequire_certificate true `
159
+ ``` conf
160
+ listener 8883
161
+ cafile /etc/mosquitto/tls/ca.crt
162
+ certfile /etc/mosquitto/tls/server.crt
163
+ keyfile /etc/mosquitto/tls/server.key
164
+ require_certificate true
165
+ ```
155
166
156
167
重启Mosquitto服务就可以用以下命令订阅和发布消息了,当然所有消息都由TLS加密,可以无忧无虑地传递私密信息啦:
157
168
You can’t perform that action at this time.
0 commit comments