-
Notifications
You must be signed in to change notification settings - Fork 46
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
ESP32 W5500 MQTT SSL #8
Comments
Hello! It looks like SSLClient is verifying the domain name even though you are attempting to connect with only an IP address (e.g. there is no domain name to verify). To clarify: when connecting with I suspect this issue is caused by your incorrect use of const char* mqttServer = "192.168.170.143";
const int mqttPort = 8883;
PubSubClient client(ethClientSSL);
...
void setup() {
...
client.setServer(mqttServer, mqttPort);
...
} The definitions of PubSubClient& setServer(IPAddress ip, uint16_t port);
PubSubClient& setServer(uint8_t * ip, uint16_t port);
PubSubClient& setServer(const char * domain, uint16_t port); Your sketch invokes the third version by passing a string as the first parameter. This version expects a domain name, however, and eventually calls You should be able to fix this issue by changing your IP address from a string to the IPAddress mqttServer(192, 168, 170, 143); This will switch your Good luck, and let me know if that works! |
Many thanks for your efforts!! Here my new Code, but the ESP32 make the same output without changes:
|
Your sketch is missing a closing parenthesis: if (client.connect("ESP32") { Is this a typo? I'm not sure what else the issue could be, but I can do some testing and get back to you. |
Oh, yes that's right, but there is normal an username and password at the end. I deleted too much, but in the original code is it right. Do you have another idea how I can use mqtt encrypted? |
Unfortunately not over Ethernet, though the ESP32 core developers are working on implementing TLS for all internet interfaces (I think here: esp8266/Arduino#6680). After some investigation, I have a few more questions:
|
I did not create the certification.h correctly, what to do with the pycert_bearssl. |
hi there, I cannot connect to mqtt ssl using eps32 w5500, I would like to know how to create certification.h correctly? because maybe mine also not coreected |
Hello,
I can easily connect to my MQTT server from my pc with the ca.cert file and on the port 8883. But the ESP32 says:
The Server shows me an new connection with the IP 192.168.170.151 without any reaction.
My actually code:
The text was updated successfully, but these errors were encountered: