2

I have to connect RabbitMQ Server from localhost. Application is built in c#. I did following settings for connect RabbitMQ

            var cf = new ConnectionFactory();
            cf.Uri = new Uri("amqps://user:pass@172.20.0.72:5671/vhost");
            cf.Ssl.Enabled = true;
            cf.Ssl.ServerName = System.Net.Dns.GetHostName();
            cf.Ssl.CertPath = @"D:\Vishal_Yagnik\DeskTop_25092018\Certi\test.p12";
            cf.Ssl.CertPassphrase = "test";
            var connection = cf.CreateConnection();

But I am getting following error.

System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Is that possible to connect RabbitMQ server from localhost. Also install cert file in local machine.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Have you tried to connect with other means? Is this port open for remote connections on target machine? – Yeldar Kurmangaliyev Oct 01 '18 at 13:16
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Oct 01 '18 at 13:41
  • I have limited experience with RabbitMQ, but, I have seen that error with general HTTP connections to outbound servers. In my case, if the client can't seem to connect on startup and there's no obvious mismatch of security credentials or authentication issues, it has been a mismatch of TLS versions. See [here](https://stackoverflow.com/questions/30664566/authentication-failed-because-remote-party-has-closed-the-transport-stream). This may fix your problem. – Philip Barile Oct 01 '18 at 14:12
  • @YeldarKurmangaliyev Yes tried . And port is open. – qadevrepublic 001 Oct 02 '18 at 06:16
  • @PhilipBarile Also that settings applied. but not working. I am also new for rabbitMQ and try to connect client RabbitMQ server from my local C# application – qadevrepublic 001 Oct 02 '18 at 06:17
  • Did you find a solution for this? I have the same issue with one of my machines in the server farms, but the other machine works fine. – Vin Shahrdar Jan 14 '21 at 20:30

0 Answers0