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); } }