Hi there!
Very much a beginner in all things message-broker, and really all things networking, so pardon if this is a simple question. I'm running into a problem on specifically Windows 7 machines where I'm unable to connect to my remote RabbitMQ server that I have setup. I know it's properly setup because it behaves like I expect when I connect to it using a Windows 10 machine from the same location, but every time I've tried to connect to the server using a Windows 7 machine using the exact same configuration as the Windows 10 machines I get an error. I have tried three Windows 7 machines, in different cities, all with the same error as far as I can tell.
My project is using .NET Framework 4.6.1, with the RabbitMQ.Client NuGet Package being on Version 6.2.1. I have tried lowering the versions of both these to see if they would make a difference to no success.
Now, I don't know if this helps, but whenviewing packets with Wiresharl (another area with which I am very much a beginner), I can see that the server never responds with a Hello and that an Alert gets sent to my Windows 7 client of "Level: Fatal" with the "Description: Insufficient Security". I have tried to combat this by setting the SSL settings of my ConnectionFactory to make sure we're using TLS1.2 to no success. Same thing with enabling TLS1.2 at the ServicePointManager.SecurityProtocol level.
I'm curious if there's a Windows patch that I need to install on the Windows 7 machines - I've seen talk on other forums about KB969083 which appears to be specifically for Windows Vista+ and Windows Server 2008+, but the few times I've seen this stuff it's always been on the server time.
Current connection code below.
---------------------------------------------------------------------------
String brokerUri = $"amqps://{RabbitMQ_IP_Address}:{RabbitMQ_Port}";
factory = new ConnectionFactory();
factory.Uri = new Uri(brokerUri);
factory.UserName = user;
factory.Password = password;
factory.AutomaticRecoveryEnabled = true;
factory.TopologyRecoveryEnabled = true;
factory.Ssl.Enabled = true;
factory.Ssl.Version = System.Security.Authentication.SslProtocols.Tls12;
connection = factory.CreateConnection();
if (connection != null)
{
// Cannot get past factory.CreateConnection();
}
Error code below.
---------------------------------------------------------------------------
Error sending data...RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.BeginReceive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
--- End of inner exception stack trace ---
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.SslHelper.<>c__DisplayClass2_0.<TcpUpgrade>b__0(SslOption opts)
at RabbitMQ.Client.Impl.SslHelper.TcpUpgrade(Stream tcpStream, SslOption options)
at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func`2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout)
at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint endpoint)
at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
--- End of inner exception stack trace ---
at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
--- End of inner exception stack trace ---
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
Thanks folks.