News:

  • August 14, 2026, 05:31:03 AM

Login with username, password and session length

Author Topic: MQTT Username and password  (Read 38278 times)

trsimmons7

  • Jr. Member
  • **
  • Posts: 16
Re: MQTT Username and password
« Reply #15 on: March 19, 2020, 03:46:04 PM »
For email, we embed the full certificate chain. For HTTPS and MQTTS we are essentially skipping the server certificate validation for now. Not sure how Mosquitto feels about self-signing. There are public free CAs out there though.

Well.... no progress on this -

I've tried two brokers and two clients. Any combination of no username/no password, username/password, TLS or no TLS works for the two broker configurations and two clients.

BUT the BRX doesn't work for anything other than no username/ no password.

I need to solve this problem. The error logs aren't helping me.

The attachments are for username/password only.

I'm digging through some wireshark logs now to find a clue......
« Last Edit: March 19, 2020, 03:58:37 PM by trsimmons7 »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: MQTT Username and password
« Reply #16 on: March 19, 2020, 04:17:36 PM »
I just set up mosquitto to use a password file. Entered one username/password combination with mosquitto_passwd.exe and changed the mosquitto.conf to point to my file. It works fine for me. I do get the "Socket error on client <unknown>, disconnecting." when the user name or password is incorrect.

Is your password really long? I think the released code is limited to 19 characters. We have new stuff coming that greatly increases that.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

trsimmons7

  • Jr. Member
  • **
  • Posts: 16
Re: MQTT Username and password
« Reply #17 on: March 19, 2020, 04:24:43 PM »
I just set up mosquitto to use a password file. Entered one username/password combination with mosquitto_passwd.exe and changed the mosquitto.conf to point to my file. It works fine for me. I do get the "Socket error on client <unknown>, disconnecting." when the user name or password is incorrect.

Is your password really long? I think the released code is limited to 19 characters. We have new stuff coming that greatly increases that.

Nope - just 9 characters!
Yeah - i can use Mqtt Explorer or mqttbox as a client with username and password and it connects. I just can't see the problem.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: MQTT Username and password
« Reply #18 on: March 19, 2020, 04:32:03 PM »
Use Wireshark. Set the filter to tcp.port == 1883 to make it easier to find what you need. Isolate the MQTT Connect Command packet. The last bytes of the packet are the user name and password. Make sure that matches what you think they should be. I'm happy to look at the packet if you'd like.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

trsimmons7

  • Jr. Member
  • **
  • Posts: 16
Re: MQTT Username and password
« Reply #19 on: March 19, 2020, 06:06:39 PM »
Use Wireshark. Set the filter to tcp.port == 1883 to make it easier to find what you need. Isolate the MQTT Connect Command packet. The last bytes of the packet are the user name and password. Make sure that matches what you think they should be. I'm happy to look at the packet if you'd like.

Well there's your problem! Hell i don't know..... ::)   ???

I attached a wireshark screen shot - one shows the correct username/password but the username and password flags are not set. This does not work.
I cleared the PLC memory - reloaded the program and it worked. See the other screenshot - correct username and password but the username and password flags are set.

I can't explain it. And I can break it again - trying to decide exactly how - not sure if its checking the tls box or the Enable Account box or a combination that does it.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: MQTT Username and password
« Reply #20 on: March 19, 2020, 07:58:16 PM »
That certainly doesn't sound right. Should be an easy bug to fix though.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: MQTT Username and password
« Reply #21 on: March 20, 2020, 09:24:44 AM »
Looks like if the will is turned on, it loses the password and user name flags. Easy fix.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

trsimmons7

  • Jr. Member
  • **
  • Posts: 16
Re: MQTT Username and password
« Reply #22 on: March 20, 2020, 03:34:54 PM »
Looks like if the will is turned on, it loses the password and user name flags. Easy fix.

I thought i was going crazy.
I'll keep an eye out for the update.

thanks
t.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: MQTT Username and password
« Reply #23 on: March 20, 2020, 04:14:56 PM »
I thought i was going crazy.
I'll keep an eye out for the update.

Well...in fairness...this doesn't prove that you aren't.  ;)

Thanks for your help (and patience) on this. I owe you a beverage of your choice or some Host swag.

Update should be out next week.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

trsimmons7

  • Jr. Member
  • **
  • Posts: 16
Re: MQTT Username and password
« Reply #24 on: March 20, 2020, 06:01:19 PM »
I thought i was going crazy.
I'll keep an eye out for the update.

Well...in fairness...this doesn't prove that you aren't.  ;)

Thanks for your help (and patience) on this. I owe you a beverage of your choice or some Host swag.

Update should be out next week.

Excellent!
Enjoy your weekend. - I'm fixing my beverage now......

thanks
t.