accessing mosquitto via port 443 and apache

  apache, docker, mosquitto, mqtt

I am running a MQTT Mosquitto server listening on port 8883 using TLS in a docker container with name ‘mosquitto’.

In another docker container in the same network I am running an Apache webserver with a webpage at my_domain (at port 443).

The Apache should forward all requests to my_domain/mosquitto to the Mosquitto broker.
using my_domain/mosquitto. Thus I add

  ProxyPreserveHost On
  ProxyPass /mosquitto ws://mosquitto:8883
  ProxyPassReverse /mosquitto ws://mosquitto:8883

to my httpd.conf which redirects https-browser-calls to my_domain/mosquitto to mosquitto.
This of course result in an OpenSSL error at Mosquitto.

But using the MQTT client (python) results in Name or service not known

What I am doing wrong?

P.S.:
The SSL keys / certificates for the Apache and the Mosquitto are different.
When disabling the webserver, redirect the Mosquitto to port 443 via docker the connection is working.

Source: Docker Questions

LEAVE A COMMENT