From 7687b8464f0770cc8a1d97e9082335bf84bb318b Mon Sep 17 00:00:00 2001 From: Rowan Skewes Date: Fri, 21 Jul 2023 11:54:07 +1000 Subject: [PATCH] mosquitto: fix bug with firefox wss http/2 Firefox has a bug preventing websockets being created with a server that uses http/2. Building libwebsockets without http/2 support fixes this issue for mosquitto. See https://github.com/eclipse/mosquitto/issues/1211#issuecomment-958137569 --- pkgs/servers/mqtt/mosquitto/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mqtt/mosquitto/default.nix b/pkgs/servers/mqtt/mosquitto/default.nix index f241f48ac52e..152332538ff9 100644 --- a/pkgs/servers/mqtt/mosquitto/default.nix +++ b/pkgs/servers/mqtt/mosquitto/default.nix @@ -17,9 +17,14 @@ let # Mosquitto needs external poll enabled in libwebsockets. - libwebsockets' = libwebsockets.override { + libwebsockets' = (libwebsockets.override { withExternalPoll = true; - }; + }).overrideAttrs (old: { + # Avoid bug in firefox preventing websockets being created over http/2 connections + # https://github.com/eclipse/mosquitto/issues/1211#issuecomment-958137569 + cmakeFlags = old.cmakeFlags ++ [ "-DLWS_WITH_HTTP2=OFF" ]; + }); + in stdenv.mkDerivation rec { pname = "mosquitto";