Search code examples
unixsslmqttmosquittosystemctl

Starting SSL authenticated MQTT broker as service on Unix


Server/client SSL authentication is enabled for MQTT broker.
When user starts broker using config file, the user is prompted to enter SSL passphrase and MQTT broker gets started after due auth check.

I have followed the below link to start MQTT broker as service,but service is failing as user is not prompted to enter password. https://alexander-rudde.com/2014/02/install-mosquitto-mqtt-broker-on-raspberry-pi-running-arch-linux/ How I can provide password for SSL server certificate if I want to start the Mosquitto broker as service.


Solution

  • The short answer is you can't, you will need to remove the password from the private key file. You can do this with openssl

    openssl rsa -in privateKey.pem -out newPrivateKey.pem
    

    This will write a new copy of the keyfile without the passphrase