Skip to content

Testing

Jeff Albrecht edited this page Feb 20, 2019 · 9 revisions

Testing

Public mqtt brokers

mosquitto.org notes

test.mosquitto.org:8883 uses a self signed certificate. You need to download their .CRT file Point your browser to test.mosquitto.org

The encrypted ports support TLS v1.2, v1.1 or v1.0 with x509 certificates and require client support to connect. In all cases you should use the certificate authority file (mosquitto.org.crt (PEM format), or mosquitto.org.der (DER format)) to verify the server connection. Port 8884 requires clients to provide a certificate to authenticate their connection. It is now possible to generate your own certificate.

mosquitto_pub -h test.mosquitto.org -t xamtest -m "date hello again" -p 8883 --cafile .../your/machine/path/to/mosquitto.org.crt

Public cert. You won't need to download their .CRT

Mosquitto_[pub|sub]

-d debug --insecure if your hostname isn't listed in the .ca

For instance

mosquitto_pub -h iot.eclipse.org -t xamtest -m "Date; date hello World" -p 8883 --cafile /etc/ssl/certs/ca-bundle.trust.crt -d --insecure

port 1883

mosquitto_pub -h 192.168.1.222 -t xamtest -m "`date` Howdy It works!"

port 8883 TLS

Using Let's encrypt. Let's encrypt can't be used to create a self signed certificate.

I'm trying to get a uniform mosquitto_pub to work. Still researching. Meanwhile I've found that these work.

Debian

mosquitto_pub -h iot.eclipse.org -t xamtest -m "`date` hello again" -p 8883 --capath /etc/ssl/certs/

CentOS

mosquitto_pub -h iot.eclipse.org -t xamtest -m "Date; `date` hello World" -p 8883 --cafile /etc/ssl/certs/ca-bundle.trust.crt

Works on my machine

With a self signed certificate.

mosquitto_pub -h redacted.org -p 8883 -t "xamtest" -m "dateA message sent on port 8883" --cafile ./ca.crt --cert ./consoleclient.crt --key ./consoleclient.key