How to enable SSL/TLS on Rasa X server in production?

Hey Community,

The reason why I need SSL/TLS on the Rasa X server is that I am using AmazonMQ to host my RabbitMQ, and AmazonMQ only supports port 5671 - which I suspect I have to enable SSL/TLS on my Rasa X.

The error I got is
ERROR:rasax.community.services.event_service:Caught an exception while consuming events.
Will retry in 5 s.

Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/rasax/community/services/event_service.py”, line 1659, in continuously_consume endpoint_config, should_run_liveness_endpoint File “/usr/local/lib/python3.7/site-packages/rasax/community/services/event_consumers/utils.py”, line 45, in from_endpoint_config broker_config, should_run_liveness_endpoint File “/usr/local/lib/python3.7/site-packages/rasax/community/services/event_consumers/pika_consumer.py”, line 73, in from_endpoint_config should_run_liveness_endpoint=should_run_liveness_endpoint, File “/usr/local/lib/python3.7/site-packages/rasax/community/services/event_consumers/pika_consumer.py”, line 54, in init host, self.queue, username, password, port File “/usr/local/lib/python3.7/site-packages/rasa/core/brokers/pika.py”, line 195, in initialise_pika_channel host, username, password, port, connection_attempts, retry_delay_in_seconds File “/usr/local/lib/python3.7/site-packages/rasa/core/brokers/pika.py”, line 72, in initialise_pika_connection return pika.BlockingConnection(parameters) File “/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py”, line 359, in init self._impl = self._create_connection(parameters, _impl_class) File “/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py”, line 450, in _create_connection raise self._reap_last_connection_workflow_error(error) pika.exceptions.IncompatibleProtocolError: StreamLostError: (‘Transport indicated EOF’,)

From some google search - I think pika.exceptions.IncompatibleProtocolError: StreamLostError: ('Transport indicated EOF',) is indicating I need TLS to send data to AmazonMQ as AWS only supports port 5671.

My current Dockerfile looks like this for the production environment:

FROM gcr.io/rasa-platform/rasa-x-ee:0.32.2 as chatbot-rasa-x

COPY ./app .
ONBUILD COPY ./app .

ENV DB_HOST="172.17.0.1"
ENV DB_PORT="5432"
ENV DB_USER="postgres"
ENV DB_PASSWORD="docker"

ENV DB_LOGIN_DB="rasa"
ENV RASA_X_USERNAME="admin"
ENV RASA_X_PASSWORD="mytestpassword1234"
ENV RASA_PRODUCTION_HOST="http://rasa-production:5005"
ENV RASA_WORKER_HOST="http://rasa-worker:5005"

ENV RASA_TOKEN="myrandomstringtoken"
ENV RABBITMQ_HOST: "amqps://b-xxxxx-f1e5-4cbf-b0e5-xxxxx22xx.mq.ap-southeast-2.amazonaws.com:5671"
ENV RABBITMQ_USERNAME: "aaaa"
ENV RABBITMQ_PASSWORD: "bbbb"

EXPOSE 8080

So… How can I enable TLS/SSL for my Rasa X server, or I misunderstood something here? Or is there a better way to separate Rasa X and RabbitMQ?

Much much appreciated for help, I’ve been struggling with it. [/quote]