Azure/azure-functions-rabbitmq-extension

Can you add support for amqps ?

LZorglub opened this issue · 2 comments

Will be very helpfull to be able to provide ssl options in RabbitMQOptions like :

.AddRabbitMQ(options =>
{
       options.Ssl.Enabled = true;
        options.Ssl.ServerName = serverName;
        options.Ssl.CertPath = @"certificate.p12";
        options.Ssl.CertPassphrase = "passphrase";
});

or better by providing the certificate collection.

options.Ssl.Certs = new X509CertificateCollection
{
     new X509Certificate2(privateKeyBytes, (string)null)
};

Adding few points on the old issue: The first two properties (Ssl.Enabled and Ssl.ServerName) will get set automatically once we use connection string starting with amqps:// (code reference).

Regarding providing a way to supply certificate collection, I doubt if that would be possible. As per my knowledge, the RabbitMQOption get deserialized from host.json when the function is running in context of an Azure Function App. We would like all Options and binding fields to be JSON-parseable. This prevents having a non-POCO C# classes (like X509Certificate2 class instance) as an option. Would like to know if I am making an error and the limitation does not exist.

What would be great is to specify a certificate thumbprint and password to an configured app service certificate. Also a keyvault reference could do the job.