From f42dd6bb4cd00533ee0b12b4ce00af820620a8b4 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 10 Nov 2017 18:34:36 -0500 Subject: [PATCH] rabbitmqconfig: accept SSL option --- ofborg/src/config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 61a1e48..550f668 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -12,6 +12,7 @@ pub struct Config { #[derive(Serialize, Deserialize, Debug)] pub struct RabbitMQConfig { + pub ssl: bool, pub host: String, pub username: String, pub password: String, @@ -31,7 +32,9 @@ pub struct CheckoutConfig { impl RabbitMQConfig { pub fn as_uri(&self) -> String{ - return format!("amqps://{}:{}@{}//", self.username, self.password, self.host); + return format!("{}://{}:{}@{}//", + if self.ssl { "amqps" } else { "amqp" }, + self.username, self.password, self.host); } }