-
Notifications
You must be signed in to change notification settings - Fork 634
Description
OpenSIPS version you are running
3.6.3~20251218~d5222226a-1 - with bug
3.5.5~20250519~7d163590b-1 - working correctly
Describe the bug
After upgrading OpenSIPS from 3.5.5 to 3.6.3, event_rabbitmq fails to authenticate to RabbitMQ using SASL PLAIN. A packet capture shows that in 3.6.3 the SASL PLAIN response contains the username but the password is missing (empty), which leads to:
ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN
The same configuration and credentials work on 3.5.5.
Password contains only alnum in this reproduction.
No TLS.
To Reproduce
Using code:
########################################################################
loadmodule "event_rabbitmq.so"
########################################################################
modparam("event_rabbitmq", "heartbeat", 0)
and
if (!raise_event("E_REG_STAT", $avp(attr-name), $avp(attr-val))) xlog("L_ERR", "[$route.name] Cannot raise E_REG_STAT event (tu=$tU@$td ci=$ci)\n");
and
startup_route {
subscribe_event("E_REG_STAT", "rabbitmq:user:[email protected]:5672/exchange=events.test.test?");
}
OpenSIPS 3.6.3 (fails)
SASL mechanism is PLAIN, but the response payload includes only the username and an empty password.
Relevant bytes:
... PLAIN .... 00 00 00 06 00 75 73 65 72 00 ...
Interpreting the PLAIN response as: 0x00 + "user" + 0x00 + "password"
gives:
"\0user\0" (password is empty)
OpenSIPS 3.5.5 (works)
SASL PLAIN response includes both username and password.
Relevant bytes:
... PLAIN .... 00 00 00 0A 00 75 73 65 72 00 70 61 73 73 ...
Which corresponds to:
"\0user\0pass"
Expected behavior
OpenSIPS 3.6.3 send packets to remote RMQ server.
The same setup is working on 3.5.5
Relevant System Logs
/usr/sbin/opensips[2058704]: ERROR:event_rabbitmq:rmq_basic_server_publish: cannot connect to RabbitMQ server 192.168.100.100:5672
/usr/sbin/opensips[2058704]: ERROR:event_rabbitmq:rmq_process: cannot send message
/usr/sbin/opensips[2058704]: ERROR:event_rabbitmq:rmq_error: Logging in: server connection error 403, message: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.