Dear Michael,
Thank you for your kind help.
After doing things similar to what is described in the links above. I did some coding in visual studio as follows:
string certPath ="C:\\Users\\mahmoud\\Documents\\Visual Studio 2010\\WebSites\\Website1\\MyCert.cer";
X509Certificate cert = X509Certificate.CreateFromCertFile(certPath);
ConnectionFactory factory = new ConnectionFactory();
Uri link=new Uri(@"amqps://hostname:5671"); // where hostname is the broker host name
factory.uri = link;
factory.Ssl.Enabled = true;
factory.Ssl.CertPath = certPath;
factory.Ssl.CertPassphrase = passwd; // the string variable passwd stores my password
factory.Ssl.Certs = new X509CertificateCollection(new X509Certificate[] { cert });
IConnection conn = null;
conn=factory.CreateConnection();
But then I get the following result in a log file that stores the exception:
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.IO.IOException: connection.start was never received, likely due to a network timeout
at RabbitMQ.Client.Framing.Impl.Connection.StartAndTune()
at RabbitMQ.Client.Framing.Impl.Connection.Open(Boolean insist)
at RabbitMQ.Client.Framing.Impl.Connection..ctor(IConnectionFactory factory, Boolean insist, IFrameHandler frameHandler)
at RabbitMQ.Client.Framing.Impl.ProtocolBase.CreateConnection(IConnectionFactory factory, Boolean insist, IFrameHandler frameHandler)
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
--- End of inner exception stack trace ---
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
at RabbitMQListener.getMessage() in c:\Users\me\Documents\Visual Studio 2010\WebSites\Website1\App_Code\RabbitMQListener.cs:line 66
After a lot of searching without any useful result, I went to the option of troubleshooting TLS connection using openssl where I have already from the brocker the following:
1- Certificate file
2- password (private key) as a string
3- link : amqps://BrokerHostName:5671
openssl s_client -connect localhost:5671 -cert client/cert.pem -key client/key.pem \
-CAfile testca/cacert.pem
However, it is not clear how to use a text password in my case and where should I include my certificate; is it -cert or -CAfile?
I appreciate your kind assistance.