I got this exception while I was trying to connect to rabbitmq. My app is running on .NET 5. i dont use private vpc i have set the mq to public
Exception: None of the specified endpoints were reachable
Then I debugged the code and found that
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host..
It tries to connect from my local machine. I was running rabbit mq locally and it was working fine but when moved to aws I got this exception.
Here are my settings for connecting to rabbitmq service
"Connections": {
"Default": {
"HostName": "myserver.amazonaws.com",
"UserName": "username",
"Password": "password",
"Port": 5671
}
}
i use event bus that attached with framework that i use to develop my project it is called abp framework here is my code to configure connection
Configure<BaseRabbitMqOptions>(options =>
{
options.Connections.Default.HostName = configuration["RabbitMQ:Connections:Default:HostName"];
options.Connections.Default.UserName = configuration["RabbitMQ:Connections:Default:UserName"];
options.Connections.Default.Password = configuration["RabbitMQ:Connections:Default:Password"];
options.Connections.Default.Port = configuration.GetValue<int>("RabbitMQ:Connections:Default:Port");
options.Connections.Default.AmqpUriSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
options.Connections.Default.VirtualHost = "/";
}
);
Update i have set my connection to use ssl and now i get this exeption
AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.@GeorgeStocker