Skip to content

Commit 4485cea

Browse files
RabbitMQ: Only set the AuthMechanisms when UseExternalAuthMechanism is set to true (#5416)
Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
1 parent cff1527 commit 4485cea

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ServiceControl.Transports.RabbitMQ/RabbitMQTransportExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ public static void ApplySettingsFromConnectionString(this RabbitMQTransport tran
3838
transport.ValidateRemoteCertificate = !disableRemoteCertificateValidation;
3939
}
4040

41-
if (dictionary.TryGetValue("UseExternalAuthMechanism", out var useExternalAuthMechanismString))
41+
if (dictionary.TryGetValue("UseExternalAuthMechanism", out var useExternalAuthMechanismString) && bool.TryParse(useExternalAuthMechanismString, out var useExternalAuthMechanism) && useExternalAuthMechanism)
4242
{
43-
_ = bool.TryParse(useExternalAuthMechanismString, out var useExternalAuthMechanism);
4443
transport.AuthMechanisms = [new ExternalMechanismFactory()];
4544
}
4645
}

0 commit comments

Comments
 (0)