alpakka icon indicating copy to clipboard operation
alpakka copied to clipboard

Does MQTT Streaming server session support username/password

Open saumilsdk opened this issue 5 years ago • 9 comments

I am using MQTT streaming flow through server session but I have clients outside of Akka to communicate with that server with credentials for security reasons. Is that supported? If yes how can I achieve that?

saumilsdk avatar Mar 04 '21 06:03 saumilsdk

I don't believe so. Maybe @huntc has a suggestion in this case.

seglo avatar Mar 09 '21 20:03 seglo

Does it support SSL/TLS by any chance?

saumilsdk avatar Mar 10 '21 05:03 saumilsdk

Does it support SSL/TLS by any chance?

The connection handling is an outside concern of mqtt-streaming. How that connection is formed is up to you. You can absolutely connect a cilent with a server via TLS.

huntc avatar Mar 10 '21 05:03 huntc

@huntc How does the mqtt-streaming will take server certificates when I used https://doc.akka.io/docs/alpakka/current/mqtt-streaming.html#flow-through-a-server-session

Both of the settings below doesn't give any TLS properties to set.

MqttSessionSettings settings = MqttSessionSettings.create();
MqttServerSession session = ActorMqttServerSession.create(settings, system);

saumilsdk avatar Mar 10 '21 05:03 saumilsdk

I am using MQTT streaming flow through server session but I have clients outside of Akka to communicate with that server with credentials for security reasons. Is that supported? If yes how can I achieve that?

You'll receive a Connect event as per the example. When you do, it is then your responsibility to acknowledge it with ConnAck.

huntc avatar Mar 10 '21 05:03 huntc

How does the mqtt-streaming will take server certificates when I used https://doc.akka.io/docs/alpakka/current/mqtt-streaming.html#flow-through-a-server-session

As mentioned above it is your responsibility to bind and connect.

huntc avatar Mar 10 '21 05:03 huntc

@huntc Thanks for helping me out but I am very new to akka so I might not understand things clearly. When you said Connect event, do we have any examples of sending Connect event with TLS certs? And how will server flow will validate client and server certs? Can you refer any examples if there are any documented?

saumilsdk avatar Mar 10 '21 07:03 saumilsdk

Hi @saumilsdk - welcome to the world of Akka! Unfortunately, I don't have any TLS examples on hand. However, if you look at the examples on the mqtt-streaming page, you'll see the use of the Tcp object. That object has functions to establish TLS connections as per the doco. Sorry that I don't have more focused examples for you.

huntc avatar Mar 10 '21 07:03 huntc

Hi @saumilsdk - welcome to the world of Akka! Unfortunately, I don't have any TLS examples on hand. However, if you look at the examples on the mqtt-streaming page, you'll see the use of the Tcp object. That object has functions to establish TLS connections as per the doco. Sorry that I don't have more focused examples for you.

Thank you @huntc this will be helpful

saumilsdk avatar Mar 11 '21 05:03 saumilsdk