Mosquitto Update auf V2 -> Verbindung nicht möglich trotz "allow_anonymous false"

Cubepower

Benutzer
Mitglied seit
21. Jun 2023
Beiträge
14
Punkte für Reaktionen
1
Punkte
3
Hallo zusammen,

nach langer Zeit des Ignorierens des Updates auf V2 des Mosquitto Paketes aus dem Synology Paketzentrum habe ich folgendes Problem.
Mir ist bewusst, dass durch das Update auf V2 standardmäßig die mosquitto.conf mit dem Inhalt der V2 template Version Version überschrieben werden muss. Zudem ist standardmäßig ohne den eben genannten Schritt nach Aktualisierung auf V2 das Verbinden ohne Credentials nicht mehr möglich.

Soweit, so gut - daher habe ich den Inhalt der mosquitto.conf unter "/var/packages/mosquitto/var" entsprechend angepasst, sodass anonyme Verbindungen wieder akzeptiert werden sollten.

Das wäre in meinen Augen dann der markierte Teil, der so aussehen muss, dass sich das ganze wieder so verhält wie unter V1.
Allerdings können weder meine MQTT Steckdosen, noch mein MQTT Client sich mit meinem Broker verbinden und ich verzweifle woran es liegt.

Sobald ich die Version 2 von Mosquitto deinstalliere und das alte Mosquitto Paket V1 über das Paketzentrum manuell wieder installiere, läuft direkt wieder alles wie geschmiert.
Das Prozedere habe ich nun mehrmals durch und frage mich warum ich offenbar zu blöd bin, zu erkennen was ich falsch mache bzw. verwundert bin, dass dies offenbar sonst niemandem so geht (die Suche spuckt wenig aus, außer dem was ich eh schon im config file verändert habe).

Hat von euch jemand vielleicht den Mosaikstein parat, der in meinem Szenario offenbar fehlt.

Danke vorab für Euren Input, VG

Code:
# =================================================================
# Security
# =================================================================

# If set, only clients that have a matching prefix on their
# clientid will be allowed to connect to the broker. By default,
# all clients may connect.
# For example, setting "secure-" here would mean a client "secure-
# client" could connect but another with clientid "mqtt" couldn't.
#clientid_prefixes

# Boolean value that determines whether clients that connect
# without providing a username are allowed to connect. If set to
# false then a password file should be created (see the
# password_file option) to control authenticated client access.
#
# Defaults to false, unless there are no listeners defined in the configuration
# file, in which case it is set to true, but connections are only allowed from
# the local machine.
allow_anonymous true

# -----------------------------------------------------------------
# Default authentication and topic access control
# -----------------------------------------------------------------

# Control access to the broker using a password file. This file can be
# generated using the mosquitto_passwd utility. If TLS support is not compiled
# into mosquitto (it is recommended that TLS support should be included) then
# plain text passwords are used, in which case the file should be a text file
# with lines in the format:
# username:password
# The password (and colon) may be omitted if desired, although this
# offers very little in the way of security.
#
# See the TLS client require_certificate and use_identity_as_username options
# for alternative authentication options. If a plugin is used as well as
# password_file, the plugin check will be made first.
# An empty password file is installed as /var/packages/mosquitto/var/passwd
# You can activate it here and add users with
# mosquitto_passwd -b /var/packages/mosquitto/var/passwd <username> <password>
#password_file /var/packages/mosquitto/var/passwd
 

schamu

Benutzer
Mitglied seit
04. Apr 2023
Beiträge
2
Punkte für Reaktionen
1
Punkte
53
Versuch mal noch ein "listener 1883" in dein configfile einzufügen.

Gruß, Thomas
 

Cubepower

Benutzer
Mitglied seit
21. Jun 2023
Beiträge
14
Punkte für Reaktionen
1
Punkte
3
Danke für den Hinweis, allerdings ist der Eintrag "listener 1883 127.0.0.1" bereits vorhanden.
Der komplette Inhalt des config-files übersteigt leider die Anzahl der hier im Post maximal zulässigen Zeichen, sonst hätte ich den Inhalt hier angefügt. Daher u.s. nur der Teil des Listeners

Code:
# =================================================================
# Listeners
# =================================================================

# Listen on a port/ip address combination. By using this variable
# multiple times, mosquitto can listen on more than one port. If
# this variable is used and neither bind_address nor port given,
# then the default listener will not be started.
# The port number to listen on must be given. Optionally, an ip
# address or host name may be supplied as a second argument. In
# this case, mosquitto will attempt to bind the listener to that
# address and so restrict access to the associated network and
# interface. By default, mosquitto will listen on all interfaces.
# Note that for a websockets listener it is not possible to bind to a host
# name.
#
# On systems that support Unix Domain Sockets, it is also possible
# to create a # Unix socket rather than opening a TCP socket. In
# this case, the port number should be set to 0 and a unix socket
# path must be provided, e.g.
# listener 0 /tmp/mosquitto.sock
#
# listener port-number [ip address/host name/unix socket path]
listener 1883 127.0.0.1

# By default, a listener will attempt to listen on all supported IP protocol
# versions. If you do not have an IPv4 or IPv6 interface you may wish to
# disable support for either of those protocol versions. In particular, note
# that due to the limitations of the websockets library, it will only ever
# attempt to open IPv6 sockets if IPv6 support is compiled in, and so will fail
# if IPv6 is not available.
#
# Set to `ipv4` to force the listener to only use IPv4, or set to `ipv6` to
# force the listener to only use IPv6. If you want support for both IPv4 and
# IPv6, then do not use the socket_domain option.
#
#socket_domain

# Bind the listener to a specific interface. This is similar to
# the [ip address/host name] part of the listener definition, but is useful
# when an interface has multiple addresses or the address may change. If used
# with the [ip address/host name] part of the listener definition, then the
# bind_interface option will take priority.
# Not available on Windows.
#
# Example: bind_interface eth0
#bind_interface

# When a listener is using the websockets protocol, it is possible to serve
# http data as well. Set http_dir to a directory which contains the files you
# wish to serve. If this option is not specified, then no normal http
# connections will be possible.
#http_dir

# The maximum number of client connections to allow. This is
# a per listener setting.
# Default is -1, which means unlimited connections.
# Note that other process limits mean that unlimited connections
# are not really possible. Typically the default maximum number of
# connections possible is around 1024.
#max_connections -1

# The listener can be restricted to operating within a topic hierarchy using
# the mount_point option. This is achieved be prefixing the mount_point string
# to all topics for any clients connected to this listener. This prefixing only
# happens internally to the broker; the client will not see the prefix.
#mount_point

# Choose the protocol to use when listening.
# This can be either mqtt or websockets.
# Certificate based TLS may be used with websockets, except that only the
# cafile, certfile, keyfile, ciphers, and ciphers_tls13 options are supported.
#protocol mqtt

# Set use_username_as_clientid to true to replace the clientid that a client
# connected with with its username. This allows authentication to be tied to
# the clientid, which means that it is possible to prevent one client
# disconnecting another by using the same clientid.
# If a client connects with no username it will be disconnected as not
# authorised when this option is set to true.
# Do not use in conjunction with clientid_prefixes.
# See also use_identity_as_username.
# This does not apply globally, but on a per-listener basis.
#use_username_as_clientid

# Change the websockets headers size. This is a global option, it is not
# possible to set per listener. This option sets the size of the buffer used in
# the libwebsockets library when reading HTTP headers. If you are passing large
# header data such as cookies then you may need to increase this value. If left
# unset, or set to 0, then the default of 1024 bytes will be used.
#websockets_headers_size
 

Cubepower

Benutzer
Mitglied seit
21. Jun 2023
Beiträge
14
Punkte für Reaktionen
1
Punkte
3
vielen Dank dir, das war die Lösung. Ich hatte es völlig übersehen, dass mein Broker durch die IP Beschränkung im Listener lediglich Verbindungen vom localhost zugelassen hat, und andere Clients sich daher nicht verbinden konnten - jetzt klappt es wieder. Danke für den Input!! :)
 
  • Like
Reaktionen: schamu


 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat 

 
 
  AdBlocker gefunden!

Du bist nicht hier, um Support für Adblocker zu erhalten. Dein Adblocker funktioniert bereits ;-)

Klar machen Adblocker einen guten Job, aber sie blockieren auch nützliche Funktionen.

Das Forum wird mit hohem technischen, zeitlichen und finanziellen Aufwand kostenfrei zur Verfügung gestellt. Wir zeigen keine offensive Werbung und bemühen uns um eine dezente Integration.

Bitte unterstütze dieses Forum, in dem du deinen Adblocker für diese Seite deaktivierst.

Du kannst uns auch über unseren Kaffeautomat einen Kaffe ausgeben oder ein PUR Abo abschließen und das Forum so werbefrei nutzen.

Vielen Dank für Deine Unterstützung!