Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support ssl connection string #19

Open
TomerGershi opened this issue Nov 28, 2021 · 1 comment
Open

Please support ssl connection string #19

TomerGershi opened this issue Nov 28, 2021 · 1 comment

Comments

@TomerGershi
Copy link

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

@odedshimon
Copy link
Collaborator

Hi @TomerGershi!

Thanks for suggesting this, it is a small change but indeed important.

I prefer that you create a PR (you need to fork this repo, then create a pull request to this repo,
Please see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork for detailed instructions).

If from some reason you still having problems to create a PR, please let us know and we will manually modify it.

Thanks,
Oded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants