Connecting to Rabbit with SSL error #1191
Replies: 2 comments 13 replies
-
Update: I switched to Propan and it works just fine. Still unsure why FastStream RabbitBroker with from propan import PropanApp, RabbitBroker
broker = RabbitBroker(
url="amqps://<url omitted>",
)
app = PropanApp(broker)
@broker.handle("test")
async def base_handler(body):
print(body) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello, @ben-xiao-io! Probably, there is some docs missundestanding: you should provide So, this is a FastStream - aio-pika arguments pairs: from ssl import create_default_context
from faststream.security import BaseSecurity, SASLPlaintext
from faststream.rabbit import RabbitBroker
security = BaseSecurity(create_default_context())
RabbitBroker("amqp://guest:guest@localhost:5672/")
# passed to aio-pika as
# {'url': 'amqp://guest:guest@localhost:5672/'}
broker = RabbitBroker("amqps://guest:guest@localhost:5672/")
# {'url': 'amqps://guest:guest@localhost:5672/'}
broker = RabbitBroker("amqp://guest:guest@localhost:5672/", security=security)
# {'ssl_context': SSLContext(), 'url': 'amqps://guest:guest@localhost:5672/'}
broker = RabbitBroker("amqps://guest:guest@localhost:5672/", security=security)
# {'ssl_context': SSLContext(), 'url': 'amqps://guest:guest@localhost:5672/'}
broker = RabbitBroker(
"amqp://localhost:5672",
security=SASLPlaintext(
username="guest",
password="guest",
)
)
# {'url': 'amqp://guest:guest@localhost:5672/'}
broker = RabbitBroker(
"amqp://localhost:5672",
security=SASLPlaintext(
username="guest",
password="guest",
ssl_context=create_default_context()
)
)
# {'ssl_context': SSLContext(), 'url': 'amqps://guest:guest@localhost:5672/'} |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is code is from the Getting Started and SSL security for Rabbit docs
https://faststream.airt.ai/latest/getting-started/
https://faststream.airt.ai/latest/rabbit/security/?h=ssl#security-objects
However I get this error when trying to connect to Rabbit AMQP hosted on CloudAMQP:
It works if I change
amqps://
toamqp://
. I have also changed the RabbitBroker to a RedisBroker (and change the url to a redis endpoint) with SSL, and it works okay. Seems to only be a RabbitBroker issue.Any suggestions or help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions