MQTTnet
MQTTnet copied to clipboard
Client-How to communicate with the server using tls-psk encryption mode?
Describe your question
I have a project that needs to communicate with an existing MQTT server.
The MQTT server uses tls-psk encryption.
I set the. WithTls () method directly and throw an exception "Win32Exception: Because of the different algorithms, the client and server can not communicate" when calling the. ConnectAsync () method.
I hope experts can help me. Thank you very much.
Which project is your bug related to?
- Client
Which version of MQTTnet are you using and which platform is the client running on (UWP, .NetCore, .NetFramwork, Xamarin, ...)?
Which version of MQTTnet are you using and which platform is the client running on (UWP, .NetCore, .NetFramwork, Xamarin, ...)?
MQTTnet version: 3.0.5 .NetCore version: 3.0
.NetCore version: 3.0 Preview 7?
I'm not yet sure whether this is supported yet. @chkr1011 Do you have details here?
.NetCore version: 3.0 Preview 7?
I'm not yet sure whether this is supported yet. @chkr1011 Do you have details here?
.NetCore version: 3.0-Preview 7
But what I want to consult is how to set the client encryption mode to tls-psk.
The server partner gave me information for connection validation: Host: tcp://172.18.xxx.xxx:8xxxx User name: Java Publishxxxxx Password: XXXXXXXX Pskid: hFxasjBiMWaSaxxxxxx PskString: pupkNACiqzk2kTwxxxxx
I don't know how to set the parameters "pskid" and "pskString" in MqttClient.
I don't know how to set the parameters "pskid" and "pskString" in MqttClient.
Yes, I did understand that. I don't know if this is even supported yet. This is something, @chkr1011 (I'm not into the code that deep yet) needs to answer. He is the owner and also main developer here ;)
I don't know how to set the parameters "pskid" and "pskString" in MqttClient.
Yes, I did understand that. I don't know if this is even supported yet. This is something, @chkr1011 (I'm not into the code that deep yet) needs to answer. He is the owner and also main developer here ;)
Well, thank you for your answer.
Based on the content of MqttClientTlsOptions.cs I assume that TLS-PSK encryption is not supported by MQTTnet.
This library makes use of the TLS stream from .net. So if a particular feature is not available in these implementations we also do not support it. This library exposes all APIs from the TLS stream which are available. If there is something missing I assume we cannot do much to solve this issue.