Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Please help. Can't connect with websocket and TLS
Please help. Can't connect with websocket and TLS [message #1848461] Thu, 02 December 2021 22:27 Go to next message
Bastian Hildner is currently offline Bastian HildnerFriend
Messages: 3
Registered: December 2021
Junior Member
hello everyone, you are my last help.I'm already trying Mosquitto with WebSocket and TSL for 3 days. I use version 2.0.11.
The firewall was turned off for testing.

the connection via TCP and unencrypted websocket works fine.

mosquitto.conf
allow_anonymous false
require_certificate false
password_file c:\mosquitto\user.txt

#mqtt
listener 1883 0.0.0.0

#websockets
listener 8883
protocol websockets
cafile c:\mosquitto\m2mqtt_ca.crt
certfile c:\mosquitto\m2mqtt_srv.crt
keyfile c:\mosquitto\m2mqtt_srv.key
tls_version tlsv1.2


#plugin C:\mosquitto\mosquitto_dynamic_security.dll
#plugin_opt_config_file C:\mosquitto\dynamic-security.json

websockets_log_level all
websockets_log_level 1023

log_type error
log_type warning
log_type notice
log_type subscribe
log_type unsubscribe
connection_messages true


I have attached the images of the error messages.
forbidding on uri sanitation
lws_return_http_status: return

Can anyone help me?








[Updated on: Fri, 03 December 2021 22:14]

Report message to a moderator

Re: Please help. Can't connect with websocket and TLS [message #1848479 is a reply to message #1848461] Fri, 03 December 2021 20:06 Go to previous messageGo to next message
Bastian Hildner is currently offline Bastian HildnerFriend
Messages: 3
Registered: December 2021
Junior Member
this may have something to do with libwebsockets. Does this need to be installed/enabled?
Re: Please help. Can't connect with websocket and TLS [message #1848480 is a reply to message #1848479] Fri, 03 December 2021 22:17 Go to previous messageGo to next message
Bastian Hildner is currently offline Bastian HildnerFriend
Messages: 3
Registered: December 2021
Junior Member
i have fixed it. I had a certificate error and extracted my .pfx to the necessary data. Now everything is working.


openssl pkcs12 -in wild.pfx -nocerts -out m2mqtt_srv.key
openssl pkcs12 -in wild.pfx -clcerts -nokeys -out m2mqtt_srv.crt
openssl pkcs12 -in wild.pfx -cacerts -nokeys -chain | openssl x509 -out m2mqtt_ca.crt
Re: Please help. Can't connect with websocket and TLS [message #1850504 is a reply to message #1848480] Mon, 07 March 2022 04:21 Go to previous message
rishabh sharma is currently offline rishabh sharmaFriend
Messages: 4
Registered: December 2021
Junior Member
Hi @Bastian Hildner, I'm facing similar issue in case of WebSockets with TLS, I did not understand the changes you did to fix the issue, in my case as well I have created all the certificates using OpenSSL and the same set of certificates seems to work with protocol mqtt and TLS but it fails to work in case of websockets with TLS.

reference - https://www.eclipse.org/forums/index.php/t/1109577/

[Updated on: Tue, 08 March 2022 04:29]

Report message to a moderator

Previous Topic:MQTT over WebSockets with TLS
Next Topic:Industry standard for data export
Goto Forum:
  


Current Time: Thu Apr 25 09:40:27 GMT 2024

Powered by FUDForum. Page generated in 0.02440 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top