0
votes

I am trying to publish event through MQTT publisher. In the provider URL have mentioned tls://URL:Port

When I am trying to execute it gives below error:. I am using apache jmeter 5.0 and MQTT jar versiion : mqtt-jmeter-0.0.1-SNAPSHOT

java.lang.IllegalArgumentException: tls://...:1887 at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:470) [org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at org.eclipse.paho.client.mqttv3.MqttAsyncClient.(MqttAsyncClient.java:273) [org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at org.eclipse.paho.client.mqttv3.MqttAsyncClient.(MqttAsyncClient.java:167) ~[org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at org.eclipse.paho.client.mqttv3.MqttClient.(MqttClient.java:224) ~[org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.(BlockingClient.java:81) ~[mqtt-jmeter-0.0.1-SNAPSHOT.jar:?] at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.initClient(PublisherSampler.java:247) ~[mqtt-jmeter-0.0.1-SNAPSHOT.jar:?] at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.sample(PublisherSampler.java:271) ~[mqtt-jmeter-0.0.1-SNAPSHOT.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Thread.java:832) [?:?]

1
Does ssl:// instead of tls:// work ?Marged
When i replaced tls with ssl, got below error: org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:604) ~[org.eclipse.paho.client.mqttv3-1.0.2.jar:?] at java.lang.Thread.run(Thread.java:832) [?:?] Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetKarry

1 Answers

0
votes

I think for MQTT you have the choice of tcp, ssl, ws and wss (the latter 2 are for MQTT over WebSocket transport) so my expectation is that you need to use ssl, not tls

Also it appears that you're using quite an outdated plugin which missing some essential features (like sending client-side certificates), maybe it would be a better idea to consider using xmeter-mqtt plugin? See Testing the MQTT Messaging Broker for IoT - A Guide article for more information.