Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mosquitto MQTT as server does not work if no SSL is used #4

Closed
franki29 opened this issue Aug 11, 2022 · 5 comments
Closed

Mosquitto MQTT as server does not work if no SSL is used #4

franki29 opened this issue Aug 11, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@franki29
Copy link

Describe the bug
If I compile your code and try without using ssl to connect to my mqtt server, the server response with a "socket error (unknown) on client"

To Reproduce
Steps to reproduce the behavior:

  1. Step1 'compile'
  2. Step2 'connect to a none secure mosquitto mqtt server.'
  3. See error

Expected behavior
Successfully connection to MQTT server without using ssl

It is working if I change the code to:
#elif defined(ESP8266)
// BearSSL::WiFiClientSecure net;
WiFiClient net;
&
#if (!defined(CHECK_PUB_KEY) and !defined(CHECK_CA_ROOT) and !defined(CHECK_FINGERPRINT))
// net.setInsecure();
#endif

Seems to be a problem using BearSSL::WiFiClientSecure net;

Br. Frank

@matthias-bs
Copy link
Owner

same as #3

@matthias-bs matthias-bs added the bug Something isn't working label Aug 11, 2022
@matthias-bs matthias-bs reopened this Aug 16, 2022
@matthias-bs
Copy link
Owner

Hopefully fixed now: ee16ad1
Could you please check?

@matthias-bs
Copy link
Owner

Hopefully fixed in v0.3.3. Please note that either #define USE_SECUREWIFI or #define USE_WIFI must be set.

I would be happy if you could give it a try!

@franki29
Copy link
Author

franki29 commented Oct 8, 2022

Hi using #define USE_WIFI is working for esp8266.
Only compiling is failing at my side because in WeatherSensor.h you use #include <WeatherSensorCfg.h> at my side I have to change it to #include "WeatherSensorCfg.h"

@franki29 franki29 closed this as completed Oct 8, 2022
@matthias-bs
Copy link
Owner

Hi,

thanks for testing and feedback! #include "WeatherSensorCfg.h" makes more sense, because it contains the sketch specific settings and not general definitions of the library.

In some (but not all) of the examples, there is

#include "WeatherSensorCfg.h"
#include "WeatherSensor.h"

I will see if I can remove the inconsistencies/redundancies.

This also relates to issue #1 and issue #11.

Thank you for pointing this out!

Best regards
Matthias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants