mikehadlow/EasyNetQ — pull request #87 by EtienneT (2013-05-27 17:46:13+00:00)
Title: Added SSL configuration options to EasyNetQ.

Hi this is my first pull request, so I am not sure if I am doing this right ;). Just added support for SSL in EasyNetQ. I followed the tutorial here (http://www.rabbitmq.com/ssl.html) using cygwin and openssl on windows to create the certificates. Then once the server is properly configured and is listening on a port for SSL, with the modification that I made in EasyNetQ, we can now do something like this to connect to a Bus:

var config = new ConnectionConfiguration()
{
Hosts = new[] { new HostConfiguration() { Host = "localhost", Port = 5671 } },
UserName = "username",
Password = "password",
VirtualHost = "/"
};
config.Ssl.Enabled = true;
config.Ssl.ServerName = System.Net.Dns.GetHostName();
config.Ssl.AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNotAvailable | SslPolicyErrors.RemoteCertificateChainErrors;

Since I didnt want to verify clients certificates I set the AcceptablePolicyErrors flags to those values. Let me know if you can test this, we are using EasynetQ in a fairly large project and absolutely need SSL.

Thanks!