Skip to content

Please support ssl connection string #19

Description

@TomerGershi

Support ssl connection (needed for AWS RabbitMQ service)
changes needed only in rabbitmq_connection_data.py:

--- a/bunny_storm/rabbitmq_connection_data.py
+++ b/bunny_storm/rabbitmq_connection_data.py
@@ -14,6 +14,7 @@ class RabbitMQConnectionData:
     port: int = 5672
     virtual_host: str = "/"
     connection_name: str = ""
+    ssl: bool = False

     def uri(self) -> str:
         """
@@ -22,4 +23,5 @@ class RabbitMQConnectionData:
         """
         vhost = "" if self.virtual_host == "/" else self.virtual_host
         name_query = f"?name={self.connection_name}" if self.connection_name else ""
-        return f"amqp://{self.username}:{self.password}@{self.host}:{self.port}/{vhost}{name_query}"
+        header = "amqps" if self.ssl else "amqp"
+        return f"{header}://{self.username}:{self.password}@{self.host}:{self.port}/{vhost}{name_query}"

Didn't had permissions to post PR myself.

Thanks,
Tomer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions