wss connection in web_mqtt #4027
-
Hello everyone, I am implementing an mqtt broker and I need to connect to my web client through wss. The problem is that the web client that is developed in Flutter Web does not have a context where it can attach the client certificates. Yes, I can do it if I compile for iOS or Android since Flutter supports the context where I can attach the certificates and it works perfectly. I currently have this setup in my rabbitmq.conf
If I connect with an mqtt client made in node.js where I can attach the certificates, the connection is successful.
But if I want to connect from the web client developed in Flutter Web, where I can't attach the certificates I get this error.
should the options In the Flutter application I have this function to connect. The output is this
On the other hand, if I want to make the connection with the web client through websockets on port 15675 and without wss, the client works perfectly on the web, but when I am in production and in an https connection, I have an error with the connection to through ws since it is not secure and it asks me to implement a wss connection. The concrete question is if I can connect with wss:// without providing certificates in the web client. Is there a way to establish the connection or does rabbitmq not allow it and the client must always attach the client certificates? I hope you can help me. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
With those settings in place RabbitMQ will not require certificates.
Yes there is. Your "Flutter" application must have a bug or something is not described correctly here. The easiest way for us to assist would be for you to provide an application I can run to reproduce the issue. |
Beta Was this translation helpful? Give feedback.
-
@carlosdomenje I took our Web MQTT sample code and added RabbitMQ configuration and certs here: https://github.com/lukebakken/rabbitmq-server-4027 Using the
What's interesting is that I do not get that message if I run
I will keep investigating. Feel free to check out the repository I made. |
Beta Was this translation helpful? Give feedback.
-
@carlosdomenje my guess is that you are using self-signed certificates like I am. You must import the CA certificate into your browser or your local CA certificate store, and your code will work. I was testing with firefox and the "Certificate" settings allow me to import the After trusting that file TLS connections worked. Please let me know if that resolves your issue. |
Beta Was this translation helpful? Give feedback.
With those settings in place RabbitMQ will not require certificates.
CLIENT ALERT: Fatal - Certificate Unknown
suggests that your client is still trying to present certificates, perhaps.Yes there is. Your "Flutter" application must have a bug or something is not described correctly here.
The easiest way for us to assist would be for you to provide an application I can run to reproduce the issue.