采用部署架构

引入JAR
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.1</version>
</dependency>
String brokerUrl = "ssl://liucc.com:8884" ;
MqttDefaultFilePersistence dataStore = new MqttDefaultFilePersistence("/User/dd/data");
MqttConnectOptions conOpt = new MqttConnectOptions();
conOpt.setCleanSession(true);
conOpt.setSocketFactory(SslUtil.getSSLSocktet(properties.getCrtPath()));
MqttClient client = new MqttClient(brokerUrl,properties.getClie

本文介绍了如何在EMQTT(EMQX)中配置SSL/TLS单向认证,并提供了Java代码示例。首先,通过部署NGINX和EMQX来搭建环境,然后引入必要的JAR包,特别强调了caPath的配置,其值为'/Users/chengcai/Desktop/docker/ca/ca.crt'。
最低0.47元/天 解锁文章
1290

被折叠的 条评论
为什么被折叠?



