Skip to content

Instantly share code, notes, and snippets.

@mohavirta
Created January 22, 2021 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohavirta/977316e6cebae4ff95c8696229222813 to your computer and use it in GitHub Desktop.
Save mohavirta/977316e6cebae4ff95c8696229222813 to your computer and use it in GitHub Desktop.
Teltonika TRB145 MQTT broker CA file optional
diff -Naur a/package/network/services/mosquitto/files/etc/init.d/mosquitto b/package/network/services/mosquitto/files/etc/init.d/mosquitto
--- a/package/network/services/mosquitto/files/etc/init.d/mosquitto 2021-01-22 12:39:16.268965752 +0200
+++ b/package/network/services/mosquitto/files/etc/init.d/mosquitto 2021-01-22 12:39:39.700963482 +0200
@@ -83,7 +83,7 @@
# Use TLS/SSL for connection
if [ "$use_tls_ssl" == "1" ]; then
if [ "$tls_type" == "cert" ]; then
- echo "cafile $ca_file" >> $CONFIG
+ [ -n "$ca_file" ] && echo "cafile $ca_file" >> $CONFIG || echo "cafile /etc/cacert.pem" >> $CONFIG
echo "certfile $cert_file" >> $CONFIG
echo "keyfile $key_file" >> $CONFIG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment